rejetto forum

Posting to HFS using Wfetch tool (HTTP Post) not saving file to folder

Switch · 10 · 3941

0 Members and 1 Guest are viewing this topic.

Offline Switch

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
Hi Team

Just assisting a client with using HFS. We are wanting to upload files to their HFS endpoint using  a HTTP Post request. We have attempted to post using Wfetch (http://download.cnet.com/WFetch/3000-2356_4-10735465.html) to test the connection. We receive a status 200 which indicates a connection is made but no files can be found in the upload folder. Normally a status 202 is received when a successful connection is made. Uploading via the HFS browser link works fine.

The following is the log details when uploading from Wfetch:
11/08/2015 12:01:38 p.m. *.*.*.*:51547 Got 2900 bytes
11/08/2015 12:01:38 p.m. *.*.*.*:51547 Requested POST /testdownload/
11/08/2015 12:01:38 p.m. *.*.*.*:51547 Served 5.4 K

Following is the log from the upload via website which was successful:
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Connected
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Got 625 bytes
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Uploading EULA.TXT
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Fully uploaded EULA.TXT - 1.6 K @ 322.3 KB/s
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Requested POST /testdownload/
11/08/2015 12:06:17 p.m. *.*.*.*:51831 Served 552
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Connected
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Got 376 bytes
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Requested GET /~img14
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Served 578
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Requested GET /~img7
11/08/2015 12:06:17 p.m. *.*.*.*:51832 Served 330


Just wanted to confirm if anyone has successfully used Wfetch to post to HFS?

Thanks




Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 757
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Thanks for reporting this. Although I have not tested WFetch, this is interesting, since HFS supports HTTP/1.1, so it should work fine with WFetch, right?...
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline skb

  • Occasional poster
  • *
    • Posts: 49
    • View Profile
This is very probably un-related, as I wasn't using WFetch, but but just a few days ago I had an issue where some uploads from my Android program were failing, and it was because they requested chunked encoding rather than sending a Content-Length.

My log output was like yours: In the failed uploads I saw the POST request without the previous "Uploading" and "Fully Uploaded" lines.

Try "Menu > Log > Log what > Requests dump", so that HFS will print the requests headers it receives. Then see if the failing cases have Transfer-Encoding chunked.

(In my case, looking with Wireshark, I saw that HFS was returning a 405 error response to the chunked mode requests, but the Android file upload routine (in the Phonegap files plugin) was losing this, and returning a 200 response to my code. The fix for me was an optional flag to this Android upload routine telling it not to use chunked mode. Perhaps WFetch has a similar no chunks option.)

Steve


Offline Switch

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
Thanks for the suggestion but still no luck.

There does not seem to be any chunked encoding settings in WFetch.
I have tried to reduce th size of the message and this also has the same results. ie I can see a connection being made but file is not transferred.

Thanks



Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 757
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
I think we must wait for the opinions from the experts (rejetto, SilentPliz, Mars, raybob, etc) about this...
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.



Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 757
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
@Switch: Unless you bring attention of this thread to any of them (by sending them a PM), you will have to be patient. If you don't get a reply in one week, you may send them a PM... ;)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
sorry for the late reply.
I don't know wfetch, but if you need to automate an upload the i guess a command-line solution would fit your needs, right?
Other people have successfully used c-url (had to type it with a dash in between because stupid security software prevents this word)
http://is.gd/naUUcp
« Last Edit: August 22, 2015, 10:43:37 AM by rejetto »


Offline brayneh

  • Occasional poster
  • *
    • Posts: 1
    • View Profile
Hi All,

I too am having the same issue as Switch, in that we have a client who uses a POST command to send us an XML order (Like what wFetch does), so we can't ask them to use a command-line script at their end.

As stated by Switch, when we test it, we also get a 200 response but no file gets saved to our server.

Is there any script that can be run from HFS that detects a HTTP POST and automatically defines a filename (something like "date and time.xml" for example) that saves a physical file. I suspect that would help the process, but admittedly i'm out of my range here.

Thanks in advance for any help with this.

Regards
BrayneH


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
POST is generic. HFS needs data to be sent as "multipart", in the POST. That's what the browser does.
See if you have such option on your side.
« Last Edit: August 31, 2015, 03:59:15 PM by rejetto »