Here is my deal. I have a form in which users upload files. I have an <input type="file" name="uploadfile"> field, which must contain the entire path to the file. I also have an <input type="text" name="filename">, which inserts
the filename only into a database. I need both fields, one with the path and one with just the filename. Is there any way to do the following:
1. Based on the info in the "uploadfile" field, use JS to strip out the path info and return only the filename, and
2. Automatically insert the filename into its field?
I know that this is a tall order, and right now I have the user responsible for entering the filename field manually, but I would love to remove their error opportunity. Any tips, pointers, or suggestions for a better way to do this?
the filename only into a database. I need both fields, one with the path and one with just the filename. Is there any way to do the following:
1. Based on the info in the "uploadfile" field, use JS to strip out the path info and return only the filename, and
2. Automatically insert the filename into its field?
I know that this is a tall order, and right now I have the user responsible for entering the filename field manually, but I would love to remove their error opportunity. Any tips, pointers, or suggestions for a better way to do this?