Upload File from Client to Server (not using HTMLInputFile)

C

Chris

Hello,

I am using asp.net. I have been searching this for a while, but dint
find any solution yet. Any help will be appreciated.

I have a string variable say 'myFile' that has complete path of a file
located in client machine. eg:
Dim myFile as string = "C:/myFolder/File1.txt"

Clicking on a button should copy that file from local client to a
location in the server.

I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it. I am not
using HTMLInputFile b'coz I dont want to store the file when I select
it after browsing. I am storing it in a string variable and later on
(in the end), I have to save/upload it in the server.

Thanks,
Chris
 
T

Tim Mackey

hi chris
browsers implement very tight security when it comes to client file system
security.
as the developer you cannot decide which file the user will upload. and for
very good reason, imagine if you could retrieve my outlook PST file just
because i browsed to your site by mistake?
fortunately it is not possible to do what you asked. you may want to look
at a windows forms client which can be run with full access to the client
file system. if the user launches your app with full trust, then you can do
whatever you like with their files.

good luck
tim
 
M

Mark Rae

Clicking on a button should copy that file from local client to a
location in the server.

You must be joking!
I am familiar with 'HtmlInputFile', but the property 'PostedFile' is
readonly. I can not assign my 'myFile' variables value to it.

And a damn good thing too!!!
 
B

bruce barker

see previous reply. there is no way other than an active/x control. as
this control will be inherently unsafe, you probably can not find one to
buy, so you will have to build it.

also while this control could be written in .net, as its unsafe, the
user would have to mark it as trusted for it to be able to access the
file system.


-- bruce (sqlwork.com)
 
C

Chris

see previous reply. there is no way other than an active/x control. as
this control will be inherently unsafe, you probably can not find one to
buy, so you will have to build it.

also while this control could be written in .net, as its unsafe, the
user would have to mark it as trusted for it to be able to access the
file system.

-- bruce (sqlwork.com)









- Show quoted text -

That makes sense. I can not use windows application. It has to be web
app. I'll try something else.
Thanks for your help !! I appreciate it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top