?
Solved

Download file from IIS

Posted on 2003-03-20
7
Medium Priority
?
2,409 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
[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
  • 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
Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

 
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

Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

770 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