Jump to content

Retain (local) Physical Path Of File Upload


Skemcin
 Share

Recommended Posts

I have a web application on Server A that has a virtual directory pointing to a network folder on Server B - other side fo the country accessible via dedicated T1. All users have Server B mapped on their desktop exactly the same way (controlled at log in). Users need to link the web application (using HTML) to the various files on Server B. So I've set up a simple form that allows them to use the browse button to select the file on Server B. When the form is submitted I need to retain the entire physical path from Server B where they selected the file. Currently the browser (by design/standards) only send the file name - truncating the physical path.Here is part of the form code:

<strong>Select a File:</strong><br /><input type="file" name="file_select" size="80" value="" /><br /><br /><cfinput type="hidden" name="file_path" value="" /><cfinput type="submit" name="btn_submit" value="GrabIt" onclick="document.myform.file_path.value=document.myform.file_select.value" />

When you are viewing the web page and you click "browse" and then you select a file, the input field shows:

x:\folder1\folder2\filename.ext

Whent he form is submitted, the value of "file_path" is equal to "filename.ext" when I need it to equal "x:\folder1\folder2\filename.ext"Anyone know of a way to capture this?NOTE: I want to do it this way. I have the skill a capabilities to use a server side scripting language to create a directory listing that a user can drill down through and then select the file they want, from which I can deduce the physical path based on the folder and file they accessed - it is my last resort, this is much quicker if it is possible.

Link to comment
Share on other sites

I noticed that IE8 has a setting on whether or not to append the path in that case, it defaults to off. If you can control the browser environment then you can set it to send the path, if you can't control the browser there's not a lot of options though. You can probably set that option for IE in a logon script if you can require everyone to use IE. You might be able to do the same for Firefox, I haven't looked at it for this. I had to do a little directory listing thing like you were describing when I set up something like that. A Flash interface might be another option, but that's not really that different from a server-side listing.

Link to comment
Share on other sites

@justsomeguyThanks for the reply - I think. :) I was afraid of that response. In my research I didn't pick up that any browser would let me do that so its an interesting option. Even with the ability to authorize a corporate push to change software settings on PCs, I wouldn't want to do it for this situation - especially since this application is only being used by upper management. Yes, I could isolate the push to their PCs but if there use any other (like one at home) then they'd be asking why it doesn't work there and then you know how that story goes, explaining anything to anyone above you is almost always above them.Anyway, thanks for the info. I've got to let this one go for now as it was a little "extra" effort I was throwing in to an internal project.Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...