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?
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.
Bookmarks