Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload File from client on server "programmatically" using file name or "programmatically" assign filename to UploadFile Control

My question have two parts

1) I want to assign filename to FileUpload Control and then save it but the problem is that it is readonly

        FileUpload1.FileName="ClientMachine\\Image1.jpeg";
        FileUpload.SaveAs(ServerMachine\\Image1.jpeg);

Is there any other way?

OR

2)I have Full path of one image at clients machine. I want to download that image.

I searched on google but most of the question do it using ajax,javascript, multipart-form . i don't have any such knowledge. Can i do it purely using C#.

like image 622
Charlie Avatar asked Oct 30 '22 11:10

Charlie


1 Answers

what you need to do is, access a file at client's computer programmatically without any explicit action from user. its not possible for obvious reasons such as the asp.net code runs on server and your file is at client. There are obvious security reasons for why you can't do it.

You may create some sort of active x or silverlight plug in and run it in elevated mode, but then again, its not recommended.

here's a similar question

like image 76
Gaurav Kalele Avatar answered Nov 15 '22 06:11

Gaurav Kalele