?
Solved

Download file from IIS

Posted on 2003-03-20
7
Medium Priority
?
2,419 Views
Last Modified: 2012-05-04
I am trying to download Excel file from server to a client's temp folder. I am using the following code
            Dim wc As New System.Net.WebClient()
            wc.DownloadFile("http://MyServer/WebReports/Reports/" & lstReports.SelectedItem.Text, "c:\temp\" & lstReports.SelectedItem.Text)

The file name I pick up from the ListBox

Every time i run this code the file is saved in c:\temp on a server not on client.
What am I missing?
0
Comment
Question by:iboutchkine
  • 3
  • 2
  • 2
7 Comments
 
LVL 10

Expert Comment

by:GoodJun
ID: 8176091
Are you trying to use asp.net as the reporting tool for client? I have tried the same thing but cann't make it work (generate report in the server and download to client), I'd also like to know how to make it work. I use another way to generate the Excel report directly send to client browser, and then they can save to their computer. It is fast and clean (don't need to give the security to every client).
0
 
LVL 28

Author Comment

by:iboutchkine
ID: 8176178
Yes I am trying to generate report on the server and then send it to client. I need to do it on server because I need connection to AS400 (which clent won't have). So far I am trying to download the file. The code above is downloading it to the server folder.
I found the way to save it on client by using Response.Redirect(http://.../filename.
But I still would like to know why the Download file is saving it on the server. I think that something is wrong with my setting.

GoodJun if I figure out the whole thing I'll let you know.
My email is iouri@hotsheet.com.
Contact me there and I will update you on my progress

Iouri
0
 
LVL 10

Expert Comment

by:GoodJun
ID: 8176285
Thanks ibout.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 3

Expert Comment

by:patriziop
ID: 8995914
DownloadFile method donwloads a  File FROM a URI not TO a URI.
Since you are executing this code in the server it 'downloads' your file from the url given (you server :-)) and the save its in the server c:\temp directory.
What you can do isntaed is create a Windows Form Control that dawloads the file to a local directory of the client and render it in the IE. (only IE)
0
 
LVL 28

Author Comment

by:iboutchkine
ID: 8996319
do you have a code sample?
0
 
LVL 3

Expert Comment

by:patriziop
ID: 8996443
Not at hand right now but for tomorrow I can have an example.
I will post it on the web
0
 
LVL 3

Accepted Solution

by:
patriziop earned 400 total points
ID: 8996734
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

SingleRun is a tool that ensures that only one instance of an application is started, running it again brings the application to focus.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

601 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