INPUT TYPE="file"
- Started
- Last post
- 8 Responses
- PeterNorf
Is it possible to use the INPUT TYPE="file" Form element so that on a page in my website (administration panel) this browse button can target a particular directory on my server to lets say select images that are already there to change my url string on image update pages???
- smokie0
do you mean you want to control the location of where the files are uploaded - or - control the location of where the files are picked from to be uploaded?
:)¬
- PeterNorf0
Im not uploading anything. See i have these ASP pages in my admin section that update News images, thumbnails etc...
The images are loaded FTP before I go into the admin section so they are already in the images file in the site directory on the server.
When I update the Table in the DB one of the fields is simply a path to an image, I would rather browse and find the image in the folder that already has the images in it, rather than write out the path everytime.
- mitsu0
common dialog box (open / save dialog box) as a tool to 'point' to a predetermined directory?
- PeterNorf0
Yes Mitsu right on, how do I do it?
- iodine740
If you are always pulling those images from the same folder, I'd just hardcoded that path (minus the filename) within the ASP. And then in your admin tool, just have the user indicate the filename itself.. and via the ASP append it to the hard-coded path.
Or if you use some sort of pathing/naming convetion use the Current Date or something. That way it's abit more dynamic for the path itself, but still have the user have to put in the file name itself.
- iodine740
Oh yeah.. and the input box where the user types in the filename, that would just be a regular type=text input. No need to mess with the 'file' type of input.
- mitsu0
to save yourself some time it would be easiest to just use teh FileSystemObject to iterate through the files in your wwroot dir and create an intuitive gui to navigate through them.
for each object, represented through an appropriate icon, you can have some hidden data in the title attribue or a hidden form field, which contains the virtual path for your files. an onclick event could flag this form element to be passed when the form is submitted and you can manipulate the data on the other side.
- PeterNorf0
hmm. So you mean i need to use JavaScript?