file upload problem 
Author Message
 file upload problem
going from my development server(mine), to a commercial has caused my file
upload script to not function.  I did a phpinfo() file and found that
file_uploads is set to 1, which I would take as..(it's ok), but
upload_tmp_dir is set as "no value", like as in, it doesnt exist?

I have tried a few work arounds such as setting the php value in a .htaccess
file...but it didnt work.  I also tried ini_set() but that gave me a wierd
result..see below

$rPath = "/tmp";
if (ini_set("upload_tmp_dir", $rPath));
 echo "changed upload dir<br>";

i get "changed upload dir" printed to the screen but it's not copying files.
The manual also says that this directive can only be set in the ini file
itself.....so why is ini_set()  returning true?

when i try and see what the value of upload_tmp_dir is..see below...

echo "x".ini_get("upload_tmp_dir")."x<br>";

all I get is "xx" printed out...
there is no value for the upload_tmp_dir directive and I cant seem to make
it have 1.  I have emailed the server admin and await a response but if I
dont get a reply that I'm looking for, would using the ftp functions be a
viable alternative...assuming php was compiled with them.  But would the ftp
functions work...if i'm trying to open a connection to the same domain...(to
be exact..all I need is to go up 2 levels and into the
images/xxxxxxxxxxxxxxxxx <dir>.

I know the files are being uploaded because I get output from the following
code:

$x = 0;
if ($HTTP_POST_FILES['pic']['name'][$x])
{
 echo $HTTP_POST_FILES['pic']['name'][$x]."<br>";
 echo $HTTP_POST_FILES['pic']['size'][$x]."<br>";
 echo $HTTP_POST_FILES['pic']['type'][$x]."<br>";
 echo $HTTP_POST_FILES['pic']['tmp_name'][$x];

Quote:
}

any1 got any insight or feedback

thnx

CMosser



Mon, 18 Apr 2005 14:11:43 GMT  
 file upload problem
did you put ..

<form enctype="multipart/form-data"> or something like that !!!
encryption type must be MULTIPART/FORM-DATA ..

php_ini

MAX_FILE_UPLOAD SIZE  (or something like that ) should be I don't know .. I
have 200 M

if that is not working .. let me know :D

bye

Armando


Quote:
> going from my development server(mine), to a commercial has caused my file
> upload script to not function.  I did a phpinfo() file and found that
> file_uploads is set to 1, which I would take as..(it's ok), but
> upload_tmp_dir is set as "no value", like as in, it doesnt exist?

> I have tried a few work arounds such as setting the php value in a
.htaccess
> file...but it didnt work.  I also tried ini_set() but that gave me a wierd
> result..see below

> $rPath = "/tmp";
> if (ini_set("upload_tmp_dir", $rPath));
>  echo "changed upload dir<br>";

> i get "changed upload dir" printed to the screen but it's not copying
files.
> The manual also says that this directive can only be set in the ini file
> itself.....so why is ini_set()  returning true?

> when i try and see what the value of upload_tmp_dir is..see below...

> echo "x".ini_get("upload_tmp_dir")."x<br>";

> all I get is "xx" printed out...
> there is no value for the upload_tmp_dir directive and I cant seem to make
> it have 1.  I have emailed the server admin and await a response but if I
> dont get a reply that I'm looking for, would using the ftp functions be a
> viable alternative...assuming php was compiled with them.  But would the
ftp
> functions work...if i'm trying to open a connection to the same
domain...(to
> be exact..all I need is to go up 2 levels and into the
> images/xxxxxxxxxxxxxxxxx <dir>.

> I know the files are being uploaded because I get output from the
following
> code:

> $x = 0;
> if ($HTTP_POST_FILES['pic']['name'][$x])
> {
>  echo $HTTP_POST_FILES['pic']['name'][$x]."<br>";
>  echo $HTTP_POST_FILES['pic']['size'][$x]."<br>";
>  echo $HTTP_POST_FILES['pic']['type'][$x]."<br>";
>  echo $HTTP_POST_FILES['pic']['tmp_name'][$x];
> }

> any1 got any insight or feedback

> thnx

> CMosser



Mon, 18 Apr 2005 17:50:10 GMT  
 file upload problem

Quote:

> going from my development server(mine), to a commercial has caused my
> file
> upload script to not function.

Does the production server has save_mode on?
Does the directorey layout differ, are there differences concerning rw
permission of the filesystem?

Jo



Mon, 18 Apr 2005 21:11:55 GMT  
 file upload problem


Quote:

> > going from my development server(mine), to a commercial has caused my
> > file
> > upload script to not function.

> Does the production server has save_mode on?
> Does the directorey layout differ, are there differences concerning rw
> permission of the filesystem?

> Jo

safemode is set to off when viewed by phpinfo()

i have the ability to dynamically create new <dir>'s with my php
script......i just cany seem to move the files...so I dont think its a rw
issue

chris



Mon, 18 Apr 2005 22:20:41 GMT  
 file upload problem


Quote:
> did you put ..

> <form enctype="multipart/form-data"> or something like that !!!
> encryption type must be MULTIPART/FORM-DATA ..

> php_ini

> MAX_FILE_UPLOAD SIZE  (or something like that ) should be I don't know ..
I
> have 200 M

> if that is not working .. let me know :D

> bye

> Armando



yes, I have multipart/form-data in the form tag

I forgot this:

Warning: Unable to open '' for reading: No such file or directory in
/users/web/onashir/web/west/html/admin/insert_car.php on line 206
test
could not be moved.
../../images/123EFTH567PKDB457/

that is the error I get when trying to upload

here is my relevant code

if (!copy($HTTP_POST_FILES['pic']['tmp_name'][$i],
"../../images/$vin/".$HTTP_POST_FILES['pic']['name'][$i]))
   {
    echo "test <br>";
    echo $HTTP_POST_FILES['pic']['tmp_name'][$i];   //why does this not get
echo'ed
    echo " could not be moved.";
    echo "<BR>";
   }
  $upfile[$i] =  "../../images/$vin/".$HTTP_POST_FILES['pic']['name'][$i];
  echo $upfile[$i]."<BR>";

It looks like its trying to open a null location and think that that is
where the problem is, I just dont know how to fix it or work around it

chris



Mon, 18 Apr 2005 22:31:02 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. File Upload Problems with binary files (ASCII works ok)

2. file upload-problem: my computer sometimes blocks

3. file upload problem

4. PHP Expert needs help with file upload problem: permission denied

5. File Upload Problems

6. NEWBIE: File upload problems

7. Q: File Upload Problem

8. Yet another file upload problem

9. Uploading Data from BASIC file Problem

10. file size upload problem

11. Problem while uploading a binary file using cgi module

12. Problem with file upload

 

 
Powered by phpBB® Forum Software