Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Сети";
Текущий архив: 2006.12.03;
Скачать: [xml.tar.bz2];

Вниз

InternetSetFilePointer   Найти похожие ветки 

 
anton773 ©   (2006-07-15 22:07) [0]

Здравствуйте все! Как правильно пользоваться функцией InternetSetFilePointer(Wininet) для докачивания файла с требуемого места.Пробую так: InternetSetFilePointer(HUrl,RestartPos,nil,0,0); функция не завершится до тех пор пока файл не будет прочитан с самого начала до требуемой позиции(зачем она вообще тогда нужна? )


 
Ketmar ©   (2006-07-15 22:21) [1]

а сайт вообще докачку поддерживает?


 
anton773 ©   (2006-07-15 22:30) [2]


> а сайт вообще докачку поддерживает?

Поддерживает.Проверено на нескольких сайтах


 
anton773 ©   (2006-07-15 22:38) [3]

Перерыл весь интернет у всех похожая проблема,решения нигде нет.Скорее всего дело Здесь в самой Wininet(сделано в "лучших традицях" микрософта) Надо переходить на Indy. Подскажите как возобновить закачку файла с требуемой позиции при помощи Tidhttp или Tidftp. Заранее спасибо


 
isasa ©   (2006-07-16 10:47) [4]

А если попытаться вырезать гланды обычным путем, т.е. через HTTP запрос?

HTTP headers
...
Request Headers
...
The Range Header
The Range header allows the HTTP client to request partial content, rather than the usual full content, by specifying a range of bytes it seeks to receive. The client should always be prepared to receive the entire content, because this is how a Web server handles an invalid range and is also how servers that do not understand the Range header respond.

To request the first 500 bytes of content, a server can include the following Range header in the request:

Range: 0-499
Ranges are represented using the hyphen character, and multiple ranges can be included separated by commas. For example, to request the first 500 bytes and the third 500 bytes, this Range header could be used:

Range: bytes 0-499, 1000-1499
The syntax also allows for open-ended ranges, such as -1000 for bytes 0-1000 and 500- to receive all but the first 500 bytes. A successful partial content response will be a 206 Partial Content.

Content-Range
The Content-Range header is used in situations when the Web server is only returning a portion of the requested resource.

An example of this header is as follows:

Content-Range: 600-900/1234
This indicates that the content being returned is bytes 600-900 only and that the entire resource is 1234 bytes. It is important to remember that the first byte of a resource is 0, so byte 1233 would be the final byte for a resource with a length of 1234 bytes.

This header is, of course, most often seen in a response to an HTTP request that includes the Range request header, such as the following example:

Range: bytes 600-900
Multiple ranges can be requested in a comma-delimited list. The syntax also allows for open-ended ranges, such as -1000 for bytes 0-1000 and 500- to receive all but the first 500 bytes (0-499). However, a Content-Range header can specify only a single range. If multiple ranges are requested, they are returned in a multipart message with a content type of multipart/byteranges.

A response including the successful partial content response will be a 206 Partial Content. If the requested range cannot be fulfilled, a response status code of 416 Requested Range Not Satisfiable is returned, and the Content-Range header will be specified as follows:

Content-Range: */1234
Note that even though the HTTP definition does not limit the use of the Content-Range header to Web servers only, it is currently not used in practice within an HTTP request.


 
isasa ©   (2006-07-16 10:53) [5]

Уточню. Я имел ввиде вот тут ...
BOOL HttpSendRequest(
 HINTERNET hRequest,
 LPCTSTR lpszHeaders,   // <--- [in] Pointer to a null-terminated string that contains the additional headers to be appended to the request. This parameter can be NULL if there are no additional headers to be appended.

 DWORD dwHeadersLength,
 LPVOID lpOptional,
 DWORD dwOptionalLength
);



 
Ketmar ©   (2006-07-16 13:15) [6]

>anton773 ©   (15.07.06 22:38) [3]
позволю себе усомниться в "перерыл весь интернет". первая же статья в ссылках гугля даёт решение.


 
anton773 ©   (2006-07-17 07:21) [7]

Спасибо! А примерчик можно плиз


 
anton773 ©   (2006-07-17 07:22) [8]

Спасибо! А примерчик можно плиз



Страницы: 1 вся ветка

Форум: "Сети";
Текущий архив: 2006.12.03;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.041 c
15-1163148108
click
2006-11-10 11:41
2006.12.03
Куча будильников (напоминаний)


4-1153033422
apic
2006-07-16 11:03
2006.12.03
работа с железом


6-1153064341
Route
2006-07-16 19:39
2006.12.03
IdIRC - dcc


2-1163530347
Youngkoder
2006-11-14 21:52
2006.12.03
ini файлы


1-1161248391
MsGuns
2006-10-19 12:59
2006.12.03
Найти символ в строке относительно мыши





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский