Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.