Connecting Tech Pros Worldwide Help | Site Map

file upload problems

  #1  
Old September 28th, 2005, 06:05 AM
jmlin84@gmail.com
Guest
 
Posts: n/a
I'm using the code:

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],
$target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']). "
has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}

but move_uploaded_file keeps returning false. I checked the $_FILES
array and all the values are correct and it seems as if the file is on
ther server. I just can't move it. Any ideas anyone?

I'm using a form to uploada the picture.

<form enctype="multipart/form-data" action="./uploadUserPhoto.php"
method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a picture to upload:
<input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>

thanks,

James

  #2  
Old September 28th, 2005, 09:05 AM
chotiwallah
Guest
 
Posts: n/a

re: file upload problems



jmli...@gmail.com wrote:[color=blue]
> I'm using the code:
>
> if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],
> $target_path)) {
> echo "The file ". basename( $_FILES['uploadedfile']['name']). "
> has been uploaded";
> } else{
> echo "There was an error uploading the file, please try again!";
> }
>
> but move_uploaded_file keeps returning false. I checked the $_FILES
> array and all the values are correct and it seems as if the file is on
> ther server. I just can't move it. Any ideas anyone?
>
> I'm using a form to uploada the picture.
>
> <form enctype="multipart/form-data" action="./uploadUserPhoto.php"
> method="POST">
> <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
> Choose a picture to upload:
> <input name="uploadedfile" type="file" /><br />
> <input type="submit" value="Upload File" />
> </form>
>
> thanks,
>
> James[/color]

no write permission in the dir you move the file to?

micha

  #3  
Old September 28th, 2005, 01:55 PM
Fran García
Guest
 
Posts: n/a

re: file upload problems


Maybe your file has a size higher than the maxim size allowed for the server

chotiwallah wrote:[color=blue]
> jmli...@gmail.com wrote:
>[color=green]
>>I'm using the code:
>>
>>if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'],
>>$target_path)) {
>> echo "The file ". basename( $_FILES['uploadedfile']['name']). "
>>has been uploaded";
>>} else{
>> echo "There was an error uploading the file, please try again!";
>>}
>>
>>but move_uploaded_file keeps returning false. I checked the $_FILES
>>array and all the values are correct and it seems as if the file is on
>>ther server. I just can't move it. Any ideas anyone?
>>
>>I'm using a form to uploada the picture.
>>
>><form enctype="multipart/form-data" action="./uploadUserPhoto.php"
>>method="POST">
>><input type="hidden" name="MAX_FILE_SIZE" value="100000" />
>>Choose a picture to upload:
>><input name="uploadedfile" type="file" /><br />
>><input type="submit" value="Upload File" />
>></form>
>>
>>thanks,
>>
>>James[/color]
>
>
> no write permission in the dir you move the file to?
>
> micha
>[/color]
  #4  
Old September 29th, 2005, 09:25 AM
Jimmy Reds
Guest
 
Posts: n/a

re: file upload problems


Hi,

If you are using PHP 4.2.0 or above then you may find that the
following page helps :
http://uk2.php.net/manual/en/feature...oad.errors.php

I was getting errors in one of my scripts then I stumbled across that
page, found out what the error actually was and was able to fix it.

Hope this helps,

Jimmy.

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with IE and (ajax) file upload via iframe: javascript error access denied/zugriff verweigert markus.rietzler@rzf.fin-nrw.de answers 3 February 15th, 2007 07:35 PM
file upload problems Arthur Jacobs answers 5 January 17th, 2007 09:35 PM
PHP File Upload Fails Vic Spainhower answers 6 December 4th, 2006 11:35 PM
Php upload problems Chris answers 0 July 16th, 2005 11:48 PM