Re: [PHP] can't upload files

2004-09-29 Thread blackwater dev
What should I look for?  I know globals are off...file_upload is on.




On Wed, 29 Sep 2004 10:08:31 +0600, raditha dissanayake
[EMAIL PROTECTED] wrote:
 blackwater dev wrote:
 
 Doesn't print out anything.
 
 
 
 
 then try phpinfo() it will tell you everything about your server, your
 script and data that is being passed to it. Look for anything amiss.
 
 print_r() those two variables (and any others you can think of).
 
 
 
 
 
 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 128 KB | with progress bar.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can't upload files

2004-09-29 Thread Jason Wong
Please do not top post.

On Wednesday 29 September 2004 21:39, blackwater dev wrote:
 What should I look for?  I know globals are off...file_upload is on.

read manual  Handling file uploads

Find out whether your version of php supports $_FILES, if so use it. If not 
use $HTTP_POST_FILES.

Do:

print_r($_FILES); // or $HTTP_POST_FILES

at the *beginning* of the page that processes the uploaded files.

and if you're still getting:

  Doesn't print out anything.

Then go back to basics and try out the example in the above chapter. If you 
can't get the example to work then re-read that chapter again (paying 
particular attention to Error Messages Explained and Common Pitfalls).

If you still can't get it to work then read the user notes in the online 
manual.

If you still can't get it to work then search the archives.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Half Moon tonight.  (At least it's better than no Moon at all.)
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] can't upload files

2004-09-28 Thread blackwater dev
--sorry if you get this twice...it didn't seem to go through the first time--

I just switched hosts and I am now working on all the stuff that once
worked but now doesn't.  I have an image upload script with the
following code:

form method='post' enctype='multipart/form-data'
action='?=$_SERVER['PHP_SELF'];??method=uploadid=? echo $id?'
   ?php
   for( $i = 0; $i  $files_to_upload; $i++ )
   {
   ?
 tr
  td colspan=5input type='file' name='file[]'
style='width: 100%'/td
/tr
   ?php
   }
   ?
   tr
  td colspan=4 align='center'input
type='submit' value='Upload'/td
/tr
/form

Then, here is part of the code doing the upload:

snip
//When REGISTERED_GLOBALS are off in php.ini
 $_POST= $HTTP_POST_VARS;
 $_GET = $HTTP_GET_VARS;

 //Upload the file
   if($_GET['method'] == upload)
   {
  echo 1br;
 $file_array = $HTTP_POST_FILES['file'];
 $uploads = false;
 for($i = 0 ; $i  $files_to_upload; $i++)
 { echo 2br;

   if($HTTP_POST_FILES['file']['name'][$i])
   { echo 3br;
/snip

It prints out the 2 but doesn't get into the 3 loopbut I am
uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES.
This worked on my last hosts servers but not the new host.  Any ideas?

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can't upload files

2004-09-28 Thread Jason Wong
On Wednesday 29 September 2004 01:44, blackwater dev wrote:

 Then, here is part of the code doing the upload:

To be precise this is the part of the code which handles the upload. The files 
have already been uploaded and stored by your webserver long before your 
script starts executing.

 It prints out the 2 but doesn't get into the 3 loopbut I am
 uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES.
 This worked on my last hosts servers but not the new host.  Any ideas?

print_r() those two variables (and any others you can think of).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Don't let your status become too quo!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can't upload files

2004-09-28 Thread blackwater dev
Doesn't print out anything.


On Wed, 29 Sep 2004 05:32:32 +0800, Jason Wong [EMAIL PROTECTED] wrote:
 On Wednesday 29 September 2004 01:44, blackwater dev wrote:
 
  Then, here is part of the code doing the upload:
 
 To be precise this is the part of the code which handles the upload. The files
 have already been uploaded and stored by your webserver long before your
 script starts executing.
 
  It prints out the 2 but doesn't get into the 3 loopbut I am
  uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES.
  This worked on my last hosts servers but not the new host.  Any ideas?
 
 print_r() those two variables (and any others you can think of).
 
 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Don't let your status become too quo!
 */
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can't upload files

2004-09-28 Thread raditha dissanayake
blackwater dev wrote:
Doesn't print out anything.
 

then try phpinfo() it will tell you everything about your server, your 
script and data that is being passed to it. Look for anything amiss.

print_r() those two variables (and any others you can think of).
   



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Can't upload files then 400K to MySQL

2003-12-28 Thread ahmetax
Hi,

I have the following PHP code to upload files to a MySQL table.

It works fine, but, I can't upload any files greater then 400K.

What might be the problem?

TIA

ahmet

?
if (isset($_POST[submit]))
{
$fname= $_FILES[user_file][name];
$tmp= addslashes($_FILES[user_file][tmp_name]);
$size= $_FILES[user_file][size];
$type=$_FILES[user_file][type];
$tanim=$_FILES[user_file][file_desc];
$fd=fopen($tmp,r) or die(Can't open file!);
$fdata=urlencode(fread($fd,filesize($tmp)));
$size=filesize($tmp);
$tanim=$descript;
include(baglan.inc);

mysql_select_db(dosyalar);
$sql=INSERT INTO files (name,file_type,file_desc,file_data,file_size).
 VALUES('$fname','$type','$descr','$fdata','$size');
mysql_query($sql);
}
?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
titleAxTelSoft-Uploading a file /title
meta http-equiv=Content-Type content=text/html; charset=windows-1254
meta http-equiv=Content-Type content=text/html; charset=iso-8859-9
meta http-equiv=Content-Language content=tr
meta http-equiv=description content=axtelsoft, indir, download, delphi,
source code, kaynak kod
meta http-equiv=Pragma content=no-cache
meta name=Generator content=Ahmet Aksoy
/head
body

form enctype=multipart/form-data action=?php echo
$SERVER[PHP_SELF];? method=post
input type=hidden name=MAX_FILE_SIZE value=16777215

Send this file: input name=user_file type=file
Explanations : TEXTAREA NAME=descript ROWS=10 COLS=45 WRAP?php
echo($descr);
?/TEXTAREA
Pinput type=submit value=Send File name=submit
/form

/body
/html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Can't upload files then 400K to MySQL

2003-12-28 Thread Raditha Dissanayake
hi

try this article: http://www.radinks.com/upload/config.php
It's a quick guide on configuring php for large file uploads.
all the best



ahmetax wrote:

Hi,

I have the following PHP code to upload files to a MySQL table.

It works fine, but, I can't upload any files greater then 400K.

What might be the problem?

TIA

ahmet

?
if (isset($_POST[submit]))
{
$fname= $_FILES[user_file][name];
$tmp= addslashes($_FILES[user_file][tmp_name]);
$size= $_FILES[user_file][size];
$type=$_FILES[user_file][type];
$tanim=$_FILES[user_file][file_desc];
$fd=fopen($tmp,r) or die(Can't open file!);
$fdata=urlencode(fread($fd,filesize($tmp)));
$size=filesize($tmp);
$tanim=$descript;
include(baglan.inc);
mysql_select_db(dosyalar);
$sql=INSERT INTO files (name,file_type,file_desc,file_data,file_size).
 VALUES('$fname','$type','$descr','$fdata','$size');
mysql_query($sql);
}
?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
head
titleAxTelSoft-Uploading a file /title
meta http-equiv=Content-Type content=text/html; charset=windows-1254
meta http-equiv=Content-Type content=text/html; charset=iso-8859-9
meta http-equiv=Content-Language content=tr
meta http-equiv=description content=axtelsoft, indir, download, delphi,
source code, kaynak kod
meta http-equiv=Pragma content=no-cache
meta name=Generator content=Ahmet Aksoy
/head
body
form enctype=multipart/form-data action=?php echo
$SERVER[PHP_SELF];? method=post
input type=hidden name=MAX_FILE_SIZE value=16777215
Send this file: input name=user_file type=file
Explanations : TEXTAREA NAME=descript ROWS=10 COLS=45 WRAP?php
echo($descr);
?/TEXTAREA
Pinput type=submit value=Send File name=submit
/form
/body
/html
 



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] can't upload files

2002-05-15 Thread Diana Castillo


I am using this script: to upload a picture file and I get the error below:
Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!  - What am I doing wrong

form enctype=multipart/form-data method=post action=do_upload.php

pstrongFile to Upload:/strongbr
input type=file name=img1 size=30/p

Pinput type=submit name=submit value=Upload File/p

/form
upload file:
?

// if $img_name isn't empty, try to copy the file
if ($img1_name != ) {

   copy($img1, /images/$img1_name)
  or die(Couldn't copy the file!);

} else {

 // if $img_name was empty, die and let us know why
 die(No input file specified);

}

?

Warning: Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can't upload files

2002-05-15 Thread Jason Wong

On Wednesday 15 May 2002 18:33, Diana Castillo wrote:
 I am using this script: to upload a picture file and I get the error below:
 Unable to create 'hgh6.gif': Permission denied in
 /home/vhtdocs/archipro/do_upload.php on line 13
 Couldn't copy the file!  - What am I doing wrong
 form enctype=multipart/form-data method=post action=do_upload.php

 pstrongFile to Upload:/strongbr
 input type=file name=img1 size=30/p

 Pinput type=submit name=submit value=Upload File/p

 /form
 upload file:
 ?

 // if $img_name isn't empty, try to copy the file
 if ($img1_name != ) {

copy($img1, /images/$img1_name)

You're trying to copy something into the directory /images. Does the 
webserver have permissions to do so?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Don't believe everything you hear or anything you say.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can't upload files

2002-05-15 Thread heinisch

At 15.05.2002  12:33, you wrote:

I am using this script: to upload a picture file and I get the error below:
Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!  - What am I doing wrong

form enctype=multipart/form-data method=post action=do_upload.php

pstrongFile to Upload:/strongbr
input type=file name=img1 size=30/p

Pinput type=submit name=submit value=Upload File/p

/form
upload file:
?

// if $img_name isn't empty, try to copy the file

You files name is in the var $img1, your refering to $img1_name !!

if ($img1_name != ) {

copy($img1, /images/$img1_name)

you should use absolute pathes
copy(/tmp/.$img1,/home/yourpath_to_virt_server/images/.$img_name)

   or die(Couldn't copy the file!);

} else {

  // if $img_name was empty, die and let us know why
  die(No input file specified);

}

?

Warning: Unable to create 'hgh6.gif': Permission denied in
/home/vhtdocs/archipro/do_upload.php on line 13
Couldn't copy the file!
HTH Oliver


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] can't upload files if extension has more than one dot.

2001-01-26 Thread Richard Lynch

 I am trying to upload the files to the sever. For files that has only one
 dot such as abc.txt and 123.doc, it works fine. But when uploading files
 that have more than one dot such as 123.txt.pdf, there's problem, and I
 tried to echo the $userfile[i], and it is "none". Codes are attached as
 following:

 FORM  name="test" method="post" action="meeting_addDocs.php"

You'll need to post or provide a URL to the source for meeting_addDocs.php
probably

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] can't upload files with more than one dot in the file name.

2001-01-26 Thread david klein

Hello!

I am trying to upload the files to the sever. For files that has only one
dot such as abc.txt and 123.doc, it works fine. But when uploading files
that have more than one dot such as 123.txt.pdf, there's problem, and I
tried to echo the $userfile[i], and it is "none". Codes are attached as
following:

FORM  name="test" method="post" action="meeting_addDocs.php"
enctype="multipart/form-data"
tr align="center"
  td valign="top" colspan="2"
  input type="file" name="userfile[]" size="18"
  /td
  td valign="top" colspan="2"
  input type="file" name="userfile[]" size="18"
  /td
   /tr
/FORM


Thank you very much in advance.

_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] can't upload files if extension has more than one dot.

2001-01-25 Thread david klein

Hello!

I am trying to upload the files to the sever. For files that has only one 
dot such as abc.txt and 123.doc, it works fine. But when uploading files 
that have more than one dot such as 123.txt.pdf, there's problem, and I 
tried to echo the $userfile[i], and it is "none". Codes are attached as 
following:

FORM  name="test" method="post" action="meeting_addDocs.php" 
enctype="multipart/form-data"
 tr align="center"
   td valign="top" colspan="2"
   input type="file" name="userfile[]" size="18"
   /td
   td valign="top" colspan="2"
   input type="file" name="userfile[]" size="18"
   /td
/tr
/FORM


Thank you very much in advance.
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]