Jump to content

Upload file


ainoy31

Recommended Posts

I have a simple page to upload files.  Here is the form page:

 

<form action="Uploader.php" method="post"><br>

Type (or select) Filename: <input type="file" name="uploadFile">

<input type="hidden" name="MAX_FILE_SIZE" value="25000" />

<input type="submit" value="Upload File">

</form>

 

Here is the PHP file to process this:

 

if ( move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],

      "../uploads/{$_FILES['uploadFile'] ['name']}")  )

      { 

  print '<p> The file has been successfully uploaded </p>';

      }

else

      {

        switch ($_FILES['uploadFile'] ['error'])

        {  case 1:

                  print '<p> The file is bigger than this PHP installation allows</p>';

                  break;

            case 2:

                  print '<p> The file is bigger than this form allows</p>';

                  break;

            case 3:

                  print '<p> Only part of the file was uploaded</p>';

                  break;

            case 4:

                  print '<p> No file was uploaded</p>';

                  break;

        }

      }

 

I am not getting any error messages or file upload to my uploads directory.  Any suggestion would be appreciated.

 

thx.

 

AM

Link to comment
https://forums.phpfreaks.com/topic/54311-upload-file/
Share on other sites

Can anyone tell me what this means?  Because I have the uploads folder in the same folder as my website.

 

Warning: move_uploaded_file(../uploads/Test file upload.doc) [function.move-uploaded-file]: failed to open stream: No such file or directory in W:\www\Uploader.php on line 11

 

thx.

 

AM

Link to comment
https://forums.phpfreaks.com/topic/54311-upload-file/#findComment-268566
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.