Forum Moderators: coopster

Message Too Old, No Replies

Having problems with file upload

Cant upload files on my server

         

don_dr

10:48 am on Aug 12, 2008 (gmt 0)

10+ Year Member



Hello guys,

i am having serious issues with uploading files to my server. the files do not even get saved in the temp directory, not to mention even moving to another.

I know this because i used the following to check;

if (!is_uploaded_file($_FILES['file']['tmp_name'])) {
echo "File was not uploaded";
exit;
}

p/s: I checked my php.ini and saw that Globals are set to off. Could this be the problem?

I am really confused right now.

sonjay

11:32 am on Aug 12, 2008 (gmt 0)

10+ Year Member



Do you get any error messages? Do you have error reporting turned on?

Have you double- and triple-checked to make sure your file input field is named "file"?

Does your form tag include enctype="multipart/form-data"?

Are file uploads enabled in php.ini?

Nutter

12:19 pm on Aug 12, 2008 (gmt 0)

10+ Year Member



What's the value of $_FILES['file']['error'] ?

don_dr

12:20 pm on Aug 12, 2008 (gmt 0)

10+ Year Member



i dont have error reporting turned on, but the others have been verified

don_dr

12:57 pm on Aug 12, 2008 (gmt 0)

10+ Year Member



I got the following error message;

Notice: Undefined index: file in /home/yell/public_html/user/upload-img.php on line 101

the code on line 101 is as follows;
if (!is_uploaded_file($_FILES['file']['tmp_name'])) {

sonjay

9:10 pm on Aug 12, 2008 (gmt 0)

10+ Year Member



Post the contents of your <form> tag and your file input tag, i.e.:

<form action="action.php" enctype="multipart/form-data" method="post">

<input type="file" name="file">

don_dr

11:46 am on Aug 13, 2008 (gmt 0)

10+ Year Member



i think the problem had to do with the "name" tag in the form. But now $_FILES[filename][error] gives the following error message;

"Array[error]"

Any solutions guys?

Thanks

sonjay

2:13 pm on Aug 13, 2008 (gmt 0)

10+ Year Member



Post the contents of your <form> tag and your file input tag.

don_dr

11:14 am on Aug 15, 2008 (gmt 0)

10+ Year Member



thanks guys! everything now seems to be in order. I guess i was kinda in a hurry and forgot some bits here and there