Passing the name of a selected file to another text box
Posted on 2006-05-12
Making an admin area where I want to allow the user to upload an image file and put the file name into the database. I have the upload part working just need to know how to set a hidden variable on the page so that it gets the results of the selected file in the correct format. For example, the user might select a file with the path c:\windows\image1.jpg. In the hidden variable that is passed to the DB I only want the name of the file to be passed (as it is being uploaded so the dir is no longer needed). What statement do I have to write to just select the filename and not the path or directory?