Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 20th, 2005, 02:02 PM
Goomba Goomba is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 20 Goomba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 47 m 17 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old April 20th, 2005, 11:02 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
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

Reply With Quote
  #3  
Old April 21st, 2005, 09:39 AM
Goomba Goomba is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 20 Goomba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 47 m 17 sec
Reputation Power: 0
Quote:
Originally Posted by Doug G
What is the description for error 87? You can write err.description in your msg box to get the text.


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"

???

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Upload files from VB with WININET


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT