Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upload to Amazon S3
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01530635
Message ID:
01530928
Vues:
124
Do you have the source version? there's a bug that's snuck in a while back and it looks like you're hitting that.
IF tnPostSize > 0
   DO CASE
      CASE !EMPTY(this.cContentType)
		 	tcHeaders = "Content-Type: " + this.cContentType + CRLF + tcHeaders      
      CASE THIS.nhttppostmode = 1
         tcHeaders = "Content-Type: application/x-www-form-urlencoded"  + CRLF +;
            IIF(!EMPTY(tcHeaders),CRLF+tcHeaders,"")
      CASE THIS.nhttppostmode = 2
         tcHeaders = "Content-Type: multipart/form-data; boundary=" + MULTIPART_BOUNDARY + CRLF + CRLF +;
            IIF(EMPTY(tcHeaders),"",tcHeaders)

         *** NOTE: extra dashes required to simulate browser operation!
         lcPostBuffer = lcPostBuffer + "--" + MULTIPART_BOUNDARY + "--"  + CRLF
         tnPostSize=LEN(lcPostBuffer)
      OTHERWISE      && CASE THIS.nhttppostmode = 4  && XML or Raw
         tcHeaders = "Content-Type: text/xml" + CRLF + tcHeaders		 
   ENDCASE
ELSE
   tcHeaders =  IIF(!EMPTY(tcHeaders),tcHeaders,"")
ENDIF
(in the wwHttp::httpgetex method - just replace that block there's only a very small change)

Basically the trailing -- were missing previously.

This has come up in the last weeks a couple of times but what's odd is that I've had this set for years and I've been using to upload to a host of different servers.

It's fixed, but not in any active release at this point. If you have source code you can make that change yourself. Otherwise I'll try to patch the existing versions.

As always you get a faster response when you post on our message board as I'm not checking here every day.

Aloha,


+++ Rick ---

>>You should use wwHttp to do this - wwIPStuff has been deprecated. Same syntax but separate object. Use the HttpGet() method which make your code simpler as well.
>>
>>
>>Main issue is that you need to use multi-part form posting for uploading a file. loHttp.nHttpPostMode = 2 should address that. In addition I'm not sure you're sending the 'file' correctly.
>>
>>Here's an example from the help file:
>>http://www.west-wind.com/webconnection/wwClient_docs?page=_0rs0twgr6.htm
>
>Thanks Rick, I'm getting much closer. Now the error message I get from S3 is The body of your POST request is not well-formed
>
>I'm using nhttppostmode=2
>
>Any ideas?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform