Re: Downloading files



This is what I was looking for:

Dim myWebClient As New System.Net.WebClient
Try
myWebClient.DownloadFile("http://www.somesite.com/somefile.pdf";,
Server.MapPath("file.pdf"))
Catch ex As Exception
Response.Write(ex.Message)
End Try

Shawn


"Shawn" <bossman100@xxxxxxxxxxx> wrote in message
news:uRc3bD7sFHA.524@xxxxxxxxxxxxxxxxxxxxxxx
> I need to make a copy of a file that is stored on a remote web server and
> not on my network. I have a complete URL to the file (ex:
> www.microsoft.com/test/testfile.pdf, www.sun.com/file2.tif) and I need
some
> code that will stream down the file, regardless of the file extension, and
> store it on my own web server. Hope this cleared things up.
>
>
>
> Shawn
>
>
> "Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> wrote in message
> news:Op4KRT6sFHA.1940@xxxxxxxxxxxxxxxxxxxxxxx
> > > How can I download a file and store it on the web server. I have a
> > > complete
> > > > URL to the file
> > I am even more confused now. If you have a path to a file, then file
must
> > necessarily exist on server disk otherwise it is a memory mapped file
and
> > exists in server memory. Assuming the former, do you intend to move the
> file
> > from one directory to another? Then, simply write the file to the
> directory
> > using one of the methods of the System.IO filestream class.
> >
> > --
> > Regards,
> > Alvin Bruney [MVP ASP.NET]
> >
> > [Shameless Author plug]
> > The Microsoft Office Web Components Black Book with .NET
> > Now Available @ www.lulu.com/owc
> > Forth-coming VSTO.NET - Wrox/Wiley 2006
> > -------------------------------------------------------
> >
> >
> >
> > "Shawn" <bossman100@xxxxxxxxxxx> wrote in message
> > news:ejCwy5wsFHA.2348@xxxxxxxxxxxxxxxxxxxxxxx
> > > Maybe you misunderstood me. Or maybe I misunderstood you :-)
> > >
> > > Anyway, what does contenttype have to do with this? I'm not talking
> about
> > > forcing a download to a client. In fact, clients are not downloading
> these
> > > files at all. The files are to be stored on the web server.
> > >
> > >
> > >
> > > Shawn
> > >
> > >
> > >
> > > "Alvin Bruney - ASP.NET MVP" <www.lulu.com/owc> wrote in message
> > > news:Oky4ScwsFHA.912@xxxxxxxxxxxxxxxxxxxxxxx
> > > > do a google on contenttype, there are several code examples of file
> > > > downloads in .NET
> > > >
> > > > --
> > > > Regards,
> > > > Alvin Bruney [MVP ASP.NET]
> > > >
> > > > [Shameless Author plug]
> > > > The Microsoft Office Web Components Black Book with .NET
> > > > Now Available @ www.lulu.com/owc
> > > > Forth-coming VSTO.NET - Wrox/Wiley 2006
> > > > -------------------------------------------------------
> > > >
> > > >
> > > >
> > > > "Shawn" <bossman100@xxxxxxxxxxx> wrote in message
> > > > news:#M6sTVwsFHA.2968@xxxxxxxxxxxxxxxxxxxxxxx
> > > > > Hi.
> > > > > How can I download a file and store it on the web server. I have
a
> > > > complete
> > > > > URL to the file, but I never know what kind of file it is. It can
> be
> > > pdf,
> > > > > jpg, tif, doc, xls etc.
> > > > >
> > > > > Thanks,
> > > > > Shawn
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


.



Relevant Pages

  • Re: Downloading files
    ... > How can I download a file and store it on the web server. ... The files are to be stored on the web server. ... >>> How can I download a file and store it on the web server. ... >>> Shawn ...
    (microsoft.public.dotnet.framework.aspnet)
  • Checking the file before downloading it with ATL Server
    ... file from my web server. ... I want to set some headers in the response, so the client will know what ... download it. ... The client uses http download. ...
    (microsoft.public.vc.atl)
  • Re: Downloading files
    ... store it on my own web server. ... >> How can I download a file and store it on the web server. ... >> forcing a download to a client. ... >>> Regards, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: DMZ and AD Authentication
    ... I second what Shawn said. ... come thru is the web server was compromised. ... authentication and have the web server authenticate to the ACS via RADIUS ... >Subject: DMZ and AD Authentication ...
    (Security-Basics)
  • Re: Printing a document from the WEB server
    ... Thanks Bruce, ... The printer is not connected to the WEB server, but it is on the same ... Shawn ... >>I have an application that allows users to download multiple documents ...
    (microsoft.public.dotnet.framework.aspnet)

Loading