Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 26th, 2007, 10:48 AM   #1
haba
Newbie
 
Join Date: Nov 2007
Posts: 10
Rep Power: 0 haba is on a distinguished road
download file

Hi,

I'm trying to download a file using the WebClient.DownloadFile method. However, my url is of the type: http://somewebsite.com/download.htm?ID=14, and it doesnt work with that method, because it uses request ids.
Does anyone have any idea how I might get this to work?

Huge thanks!
haba is offline   Reply With Quote
Old Nov 26th, 2007, 11:15 AM   #2
haba
Newbie
 
Join Date: Nov 2007
Posts: 10
Rep Power: 0 haba is on a distinguished road
Re: download file

Nevermind, got that working.
However, I have another problem: I want to save the file in my computer with the name it has on the server... How can I do it?

Thanks again
haba is offline   Reply With Quote
Old Nov 26th, 2007, 2:43 PM   #3
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,186
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: download file

Quote:
Originally Posted by haba
Nevermind, got that working.
However, I have another problem: I want to save the file in my computer with the name it has on the server... How can I do it?
This request doesn't make sense. In many cases, such as with dynamic content, there is no actual file. Rather, a stream of data is generated on-demand by the server, and sent across to the client. In these cases, the data only exists in file form if it has been cached from an earlier request for the same content.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Nov 26th, 2007, 2:46 PM   #4
haba
Newbie
 
Join Date: Nov 2007
Posts: 10
Rep Power: 0 haba is on a distinguished road
Re: download file

Quote:
Originally Posted by lectricpharaoh View Post
This request doesn't make sense. In many cases, such as with dynamic content, there is no actual file. Rather, a stream of data is generated on-demand by the server, and sent across to the client. In these cases, the data only exists in file form if it has been cached from an earlier request for the same content.
Ok, but even if it is so, when I try to go to that url using my browser, the download file window appears, and the file to download has a name and an extension.
Just doing WebClient.DownloadFile, I dont know the filename nor the extension.
haba is offline   Reply With Quote
Old Nov 26th, 2007, 3:13 PM   #5
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 4 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Re: download file

Will you post how you solved the problem?
PhilBon is offline   Reply With Quote
Old Nov 26th, 2007, 3:56 PM   #6
haba
Newbie
 
Join Date: Nov 2007
Posts: 10
Rep Power: 0 haba is on a distinguished road
Re: download file

Quote:
Originally Posted by PhilBon View Post
Will you post how you solved the problem?
The WebClient.DownloadFile worked afterall, I just did a mistake with the uri.
haba is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid default dialog box for file download? java_roshan Other Web Development Languages 1 Sep 12th, 2006 10:38 PM
Download EXE file from HTTP server bobfox Other Programming Languages 10 Dec 19th, 2005 11:12 AM
Error Trapping and putting a program on a web site not as a file download. Eragon229 Python 6 Aug 25th, 2005 6:57 PM
After execution - Error cannot locate /Skin File? wchar Visual Basic 1 Mar 5th, 2005 10:04 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 5:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:26 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC