Results 1 to 40 of 66

Thread: Winsock: HTTP File Upload

Hybrid View

  1. #1
    New Member
    Join Date
    May 2006
    Posts
    2

    Re: Winsock: HTTP File Upload

    Thank for your reply and your great program first!!

    After many times of try and error, I found that it can upload jpg under ENGLISH WinXP, but not in CHINESE WinXP.

    for CHINESE WinXP:
    There are no error when uploading jpg file, but when I try to download the jpg file from server, I found that the content of jpg is changed and it can't be opened again. May be it is becasue of the encoding problems?

  2. #2
    New Member
    Join Date
    Jul 2006
    Location
    San Salvador, El Salvador
    Posts
    2

    Thumbs up Re: Winsock: HTTP File Upload

    Hi!, in first place let me thank you for share your code visualAd, second a few questions about it:

    1)Could your code work with "multipart/form-data" header type?
    2)Wich is the max size of the file that can effectively be send?, despiting the servers limitations.
    3)How necessary is to do it with winsock.ocx?, it's difficult to do it through winsocks APIs?, does need winsock.ocx be packed along the aplication?
    4)Could your code be reproducible with Wininet APIs?

    Thanks in advance. Glad to see that someone is sharing this kind of hard to find but high usable code.

  3. #3

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Winsock: HTTP File Upload

    1)Could your code work with "multipart/form-data" header type?
    What do you mean? It uses the multipart/form-data header in the HTTP request and sends the HTTP request as a multipart document.

    2)Wich is the max size of the file that can effectively be send?, despiting the servers limitations.
    I am not sure probably the size of a VB string 64k. However, with anything bigger, VB should use swap or other mechanisms to handle the string. I am no VB guru so cannot say for sure.

    3)How necessary is to do it with winsock.ocx?, it's difficult to do it through winsocks APIs?, does need winsock.ocx be packed along the aplication?
    In theory the ocx should be included. If not, you need to ensure that the control is installed on the OS you are running the program on and hope that if it is installed the version is compatible withh the one you've used.

    Winsock is included by default from windows 98+, so I would imagain you'd be quite safe.

    4)Could your code be reproducible with Wininet APIs?
    I should hope so, as this is exaclty what the Winsock control is a wrapper for
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    New Member
    Join Date
    Jul 2006
    Location
    San Salvador, El Salvador
    Posts
    2

    Re: Winsock: HTTP File Upload

    Quote Originally Posted by visualAd
    What do you mean? It uses the multipart/form-data header in the HTTP request and sends the HTTP request as a multipart document.
    Yes sorry, just notice that in the code, I got confused when see this:

    VB Code:
    1. ' Content-Disposition: form-data; name="UploadName"; filename="FileName"

    Later I see this:
    VB Code:
    1. ' Content-Type: multipart-form-data, boundary=boundary

    Quote Originally Posted by visualAd
    I am not sure probably the size of a VB string 64k. However, with anything bigger, VB should use swap or other mechanisms to handle the string. I am no VB guru so cannot say for sure.in the HTTP request and sends the HTTP request as a multipart document.
    Ok, lets say I want to send a 500KBs file, supossing that limit is 64KB, I should use a string class or there's a way to send chunks of data at time?

    Quote Originally Posted by visualAd
    In theory the ocx should be included. If not, you need to ensure that the control is installed on the OS you are running the program on and hope that if it is installed the version is compatible withh the one you've used.
    Winsock is included by default from windows 98+, so I would imagain you'd be quite safe.
    So it will be ok for most cases to do it with winsock.ocx rather than directly calls to winsock.dll?

    Quote Originally Posted by visualAd
    I should hope so, as this is exaclty what the Winsock control is a wrapper for
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width