|
-
May 8th, 2006, 02:50 AM
#1
New Member
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?
-
Jul 17th, 2006, 02:39 PM
#2
New Member
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.
-
Jul 17th, 2006, 03:04 PM
#3
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
-
Jul 17th, 2006, 03:14 PM
#4
New Member
Re: Winsock: HTTP File Upload
 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:
' Content-Disposition: form-data; name="UploadName"; filename="FileName"
Later I see this:
VB Code:
' Content-Type: multipart-form-data, boundary=boundary
 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?
 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?
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|