Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-03
4
Medium Priority
?
497 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

610 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