473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Download/Resume

How do I download a file & resume from where it left off at a later time/date?

Any ideas?
Nov 21 '05 #1
4 2422
On 2005-03-01, Crouchie1998 <Cr**********@d iscussions.micr osoft.com> wrote:
How do I download a file & resume from where it left off at a later time/date?

Any ideas?


What protocol are you using to download the file? Both http and ftp are
capable of resuming downloads - or is this a custom protocol? The
answers to these questions will help you get a proper answer...

--
Tom Shelton [MVP]
Nov 21 '05 #2
I am using http (System.Net.Htt pWebRequest) to download the file
Nov 21 '05 #3
In article <3A************ *************** *******@microso ft.com>, Crouchie1998 wrote:
I am using http (System.Net.Htt pWebRequest) to download the file


Ok... You'll want to use the HttpWebRequest. AddRange method before you
try and resume the download... You'll look at how many bytes your
recieved and want to start at the next byte. So say you got 50 bytes of
a 100 byte file... you would call:

' - indicates from this position to end of data
myWebRequest.Ad dRange (-51)

Does that make sense? You are basically setting the HTTP Range header.

--
Tom Shelton [MVP]
Nov 21 '05 #4
OK. Thanks, but I need to keep the file as a byte array & then open it from
the next byte I think. How do I do about doing all this (code sample please)?

"Tom Shelton" wrote:
In article <3A************ *************** *******@microso ft.com>, Crouchie1998 wrote:
I am using http (System.Net.Htt pWebRequest) to download the file


Ok... You'll want to use the HttpWebRequest. AddRange method before you
try and resume the download... You'll look at how many bytes your
recieved and want to start at the next byte. So say you got 50 bytes of
a 100 byte file... you would call:

' - indicates from this position to end of data
myWebRequest.Ad dRange (-51)

Does that make sense? You are basically setting the HTTP Range header.

--
Tom Shelton [MVP]

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3622
by: | last post by:
I am having a major problem with file transfers - they are ending early when the bandwidth tops-out. Smaller files transfer just fine, but large files (12Mb+) can 'abort' the transfer after maybe 35%-60% complete. I'm sending large MP3 files from my website www.TheDoctorDementoShow.com but the users are pretty upset because the files are incomplete. I assume tis has something to do with headers or starting/stopping as the bandwidth...
7
3651
by: Navin | last post by:
hi, i am using the follwoing code to write a recordset to a csv file 'fcreateFile -file system object Do While Not oRs.EOF fcreateFile.Write(oRs.GetString(,1000,",",vbcrlf,"")) 'Write Login Info loop
18
4335
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't get it to upload a file to the FTP server. I just get a "Cannot connect to remote server" error after this TRY: s = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
6
3401
by: Hanspeter Leupin | last post by:
Hi NG, I used the Internet Data Transfer Library of Dev Ashish found at http://www.mvps.org/access/modules/mdl0037.htm to transfer text files from a server with HTTPS in my old Ms Access 97 application. '----snip---- Sub TestHTTP() On Error GoTo ErrHandler Dim objHTTP As InetTransferLib.HTTP
1
1364
by: uto | last post by:
can i make resume web page into word or excel file? resume web page type is table and include photo and etc how can i make this? is there crystalreport to implement this?
5
12291
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. On Beta1, I am able to execute a particular page with no problem, that page opens up in the comes up just fine. On Win2kdev1, when I go to execute the same page, it opens a file download dialog and asks me whether I want to open or save the...
1
2445
by: Chameleon | last post by:
I want to send a static file, via php to browser with ability to resume download. This is the code: -------------------------------------------- function send_file($file, $offset = 0, $offset2 = -1) { @$a = filesize($file); if ($offset2 <= $offset || $offset2 < 1) $offset2 = $a - 1; if ($offset2 <= $offset || $offset < 0) $offset = 0; header("Content-Range: bytes $offset-$offset2/$a");
4
6901
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the function creates the file as expected. When I loop through my array I get the error - "ArgumentException was unhandled - Illegal characters in path" The value "C:\Temp.txt" is the first value in the array - as it works
4
2025
by: Irfan12 | last post by:
I am using the following PHP code to force the internet browser to download a media file(e.g, .mp3, .wma), But in this code, there is no resume support in downloading these files. i dont know PHP, i am very much thankful to the person who gave me this code. Kindly tell me, that what changings are to be needed to enable resume support in downloading. Thankyou. <?php if((array_key_exists('file', $_GET)) && ($fp = @fopen($_GET, 'rb'))...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.