Uploading problem
Posted by: sn666 (---.lubin.dialog.net.pl)
Date: September 04, 2006 02:59PM

Hi,
I have problem with uploading files (size and kind of file is indifferent). I use this simple script to upload:

<form method="post" action="test2.php" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="30000000">
Choose file:<br>
<input type="file" name="my_file"><br>
<input type="submit" value="Upload"><bR><Br><Br>

test2.php:
<?php
if(isset($_FILES["my_file"]))
{
if (!is_uploaded_file($_FILES['my_file'])) die ('file not uploaded');
move_uploaded_file($_FILES['my_file']['tmp_name'],"pliki/".$_FILES['my_file']['name']);
} else {echo 'no file';}
?>

If I upload file i have 'file not uploaded' message.. why ?
Can't copy or move file becouse it isn't in tmp folder.
my old scripts aren't working too sad smiley
I have Wamp5 server 1.6.1
What can be wrong ?
Thx 4 Your time

Options: ReplyQuote
Re: Uploading problem
Posted by: CyberSpatium (67.170.181.---)
Date: September 05, 2006 01:57AM

check your php.ini file and make sure uploads are turned on
file_uploads = On

for your temp directory... the setting set in the php.ini file is correct and valid, however for some reason it never worked for me too. but I found a setting that works. so find
upload_tmp_dir = "C:\wamp\tmp"

and change it to
upload_tmp_dir = "C:\WINDOWS\Temp"

And then find
upload_max_filesize = 2M

change the 2M part to how large of files you want to upload. for example if you are going to be uploading files that are 50 megabytes in size, set it to 50M.

save the file, and restart apache for the new settings to take effect.

Options: ReplyQuote
Re: Uploading problem
Posted by: sn666 (---.lubin.dialog.net.pl)
Date: September 10, 2006 11:31AM

tmp folder in wamp was set to 'read only', after I change it everything works great smiling smiley
Thats strange because I install wamp few few times (before installing wamp folder was deleted)

I hope it will be helpful for someone smiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.