About address after uploaded

Nov 1, 2009 at 12:49 PM
Edited Nov 1, 2009 at 12:51 PM

I want to know the addresses of the files uploaded. But how can I get it?

e.g.
I upload a file "C:\test.txt"
It will be "http://www.example.com/upload/test_xxxx.txt" after upload (via my upload handler and the xxxx is random)
But how can I get the address by js and server side code?

Thanks!

Coordinator
Nov 1, 2009 at 1:47 PM

On the server side http handler there's an UploadFinished method which has the input of the file name. There you can move the file, rename the file etc.

The client side does not know the location of the uploaded files. It's a possible scenario that uploaded files are not allowed to be downloaded. So there's no standard way to get the location of the uploaded file. It totally depends on your implementation of the http handler.

With javascript you can get the list of files and get an event when a file upload is finished (see Javascript example page in the project). If you dont rename the files serverside, you can write some custom javascript to determine the location of the uploaded file.

Hope this helps,
Michiel Post