www.webdeveloper.com
Results 1 to 4 of 4

Thread: using HTML input type = "file"

  1. #1
    Join Date
    Nov 2007
    Posts
    11

    using HTML input type = "file"

    I'm creating an input form for users so that they can input various bits of info into a db. One of the fields is so that they can upload a file, which puts the file onto the web server and the path to it into the db. The problem is if anyone edits the data after a file has been uploaded, the path to the file gets overwritten in the db with an empty string. I get round this problem in all other entry fields by pulling the data out the db and putting in the form entry box, but can't find a way to do this using the input type = "file" tag. Does anyone know how to do this?

  2. #2
    Join Date
    Jun 2009
    Posts
    98
    You should show the script your using when people "update" the data.

  3. #3
    Join Date
    Feb 2006
    Posts
    520
    input type file is used to browse files on local puter so even if you could place file location in there it would not do you any good. What you need to do is only update database fields with file path and filename only if new file is provided otherwise just don't update. You can also create hidden fields for filename and file path if you really need to have it.

  4. #4
    Join Date
    Nov 2007
    Posts
    11
    Thanks guys, I've got it all working now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles