?
Solved

How do I copy a file from a web server to the users local machine

Posted on 2011-03-03
4
Medium Priority
?
496 Views
Last Modified: 2012-05-11
I am attempting to copy a selected file from the web server to a user's desktop on their local machine using the Environment variables .MachineName and .SpecialFolder.Desktop. The application works fine when running in Visual Web Developer on my local machine but when I upload the application to the web server and run it from a browser on my local machine it copies the files to my desktop on the server. The .MachineName environment variable shows the web server name rather than my local machine name.
0
Comment
Question by:Duder258
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35031341
Yes, there is no way you can copy files to a users desktop without using a download dialog that is part of a file download process that you initiate with the user opting to begin the process.

You have no access whatsoever to a users file system. You may read/write/delete N+1 files to the web server you run on but that's it.
0
 

Author Comment

by:Duder258
ID: 35031418
Actually that is what I would like to accomplish here. As the application works now, the user presses a "Download" button next to the file they want downloaded and I am wantinf it placed on their desktop. You mention a download dialog that is part of a download process in your comment. Can you expand upon what I need to do and or use to make that happen?

Thanks
0
 
LVL 33

Accepted Solution

by:
raterus earned 1000 total points
ID: 35062168
The only easy way this is going to work is if your user and server are on the same domain, and the user's computer is not firewalled.

Then, you can copy to the user's computer by creating a string like so

\\(User's IP Address\c$\Files\test.txt

e.g.
\\192.168.1.123\c$\Fles\test.txt

With that said, this will get very tricky since each user workstation will have to be configured properly.  It's probably much easier to just give them a link to download/save to their computer.  You can use Response.WriteFile(...) to do that.
0
 

Author Closing Comment

by:Duder258
ID: 35114041
Thanks. This got me going and now it works.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question