tags:

views:

25

answers:

2

I'm not a flash dev, but I'm turning to it to try and meet a requirement. I'm to allow a user to select a file on their computer, then pass it to my web application. I know it's not possible to do this using Javascript, hence wanting to use flash. First, is this possible? Second, can I get a pointer on how its done?

To clarify: I'm just looking for the path to the file. I don't want to upload it.

+1  A: 

Well it depends what you want to do with that file. There's the FileReference object that will allow you to browse and upload a file to a server, and from there you can load it into your application. If you're targeting Flash Player 10, then you have access to new api's that will allow you to load the the files directly from the local machine.

quoo
All I'm looking for is the *path* to the file. I don't want to actually upload it.
jeffkolez
I don't think you can access that in a webapp. In a AIR app however you can, using the File class: http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html
quoo
Oh, I should note, adobe specifically does not allow you to access the full path of a local file for security reasons.
quoo
Yeah, that's what I'm figuring. Ah well, have an upvote.
jeffkolez
+1  A: 

You cannot access the local path of a file with Flash. Adobe claims that it's a security risk... I tend to disagree and find that information to be invaluable. Alas, it cannot be done.

You may be over thinking it. Just use FileReference and upload the file onto the server and update your web application of the change. No?

dcolumbus
Nah, the business requirement is to have a path to the file linked to a local file. The only people using this application are people inside the company intranet, so the paths are static.
jeffkolez
If this app is only being deployed within a company, couldn't it be an AIR app?
quoo
Even if it wasn't an internal only application, AIR would be a great choice.
dcolumbus
The rest of the app is written in JSP. This is only one feature.
jeffkolez