Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Upload Restrictions For txt File Not working

  1. #11
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by sabinmash View Post
    Weird, it's still not working even with your code. This is my html, is there something wrong with it that has to do with the upload not working?

    Code:
    <form name="myform" enctype="multipart/form-data" action="Slides03_ex1_process.php">
    <input name="upload" type="file">
    </FORM>
    your form names the file "upload" while your php script is looking for a file named "file". (there's also no submit button, but I assume you're submitting it somehow.)

    More importantly, your form is inside another form. This is invalid and will break in some browsers, and be (at best) unpredictable in others. Your file upload either needs to be part of the larger form, or you need to move the upload form outside of the larger form.

  2. The Following User Says Thank You to traq For This Useful Post:

    sabinmash (10-01-2011)

  3. #12
    Join Date
    Sep 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Originally Posted by traq

    your form names the file "upload" while your php script is looking for a file named "file". (there's also no submit button, but I assume you're submitting it somehow.)

    More importantly, your form is inside another form.
    Thank you so much, that was exactly the problem! I learned a lot!

  4. #13
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    No problem.

    If your question has been answered, please mark your thread "resolved":
    • On your original post (post #1), click [edit], then click [go advanced].
    • In the "thread prefix" box, select "Resolved". Click [save changes].

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •