|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Upload files from VB with WININET
Good day to all. I have a problem using WinInet to upload a file to a web server. I get error 87 when I try to execute HTTPsendRequesstEX. I'm using sendRequestEX as I need Async communications.
I have a valid internet File Handle and there are no permissions issues on the server (IIS is installed on my laptop). Here is the code snippet: **** START OF SNIPPET **** hRequest = HttpOpenRequest(hConnect, "PUT", "/filer/test.txt", vbNullString, vbNullString, 0, INTERNET_FLAG_NO_CACHE_WRITE, 0) Rem *** All GOOD to here. at this point I have a valid connection to the server. ' This is the way it Must be called. 'BOOL HttpSendRequestEx( ' HINTERNET hRequest, Handle returned by HttpOpenRequest. ' LPINTERNET_BUFFERS lpBuffersIn, Optional. Pointer to an INTERNET_BUFFERS structure ' LPINTERNET_BUFFERS lpBuffersOut, Optional. Pointer to an INTERNET_BUFFERS structure ' DWORD dwFlags, reserved and MUST be set to zero ' DWORD dwContext Application-defined context value '); Status = HttpSendRequestEx(hRequest, IB, vbNull, 0, 0) ' THISS CAUSES THE ERROR If Status = 0 Then ' HERE IS WHERE I CATCH THE ERROR MsgBox ("HttpSendRequestEx Err: " & Err.LastDllError) Unload Me End End If **** END OF SNIPPET **** I have already developed FILE DOWNLOAD code (which is extremely fass -> 80 mb in about 2 minutes). I need to have an UPLOAD FILE piece for a project that I am working on in house. Any help would be greatly appreciated. Thanks Goomba ps: please feel free to email me directly at: rgutery@mentorits.com |
|
#2
|
|||
|
|||
|
What is the description for error 87? You can write err.description in your msg box to get the text.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Quote:
Actually Doug, you cannot use err.description, one has to use GETlastdLLerr. In any case, it means "Inbuffer (or the buffer you are using) is Unmanaged" ??? |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Upload files from VB with WININET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|