Multipart - Create form-data for http request

Post your working scripts, libraries and tools for AHK v1.1 and older
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Multipart - Create form-data for http request

09 Mar 2014, 18:29

New Version:

CreateFormData - Creates "multipart/form-data" for http post
https://autohotkey.com/boards/viewtopic.php?f=6&t=7647
This function is similar to the cURL option "--form".

Class Multipart (Only works in ANSI!)
Spoiler
Usage: Multipart.Make(ByRef PostData, ByRef PostHeader, "name=content" [, "name=content", ...])
To force the 'content' part to be a file, prefix the file name with an @ sign. To just get the content part from a file, prefix the file name with the symbol <.

Examples:
  • Example 1 - Upload image to Google Images
    Spoiler
  • Example 2 - Upload image to http://uploadpie.com/
    Spoiler
  • Example 3 - Upload code to http://pastebin.com
    Spoiler
:arrow: Download: https://www.dropbox.com/s/coxud571yseda6q/Multipart.7z

Hope someone can make a Unicode version, and a WinHttp sample. I've asked this question at here weeks ago.
Last edited by tmplinshi on 14 Mar 2016, 04:48, edited 1 time in total.
nepter
Posts: 5
Joined: 22 Dec 2013, 20:07

Re: Multipart - Create form-data for http request

22 Sep 2014, 02:18

Unicode problem solved?
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Multipart - Create form-data for http request

22 Sep 2014, 02:20

not yet... can you help? ^_^
nepter
Posts: 5
Joined: 22 Dec 2013, 20:07

Re: Multipart - Create form-data for http request

22 Sep 2014, 22:19

Wait for VxE to update multipart support in HTTPRqeuest.
Or modify yourself
User avatar
Peace1
Posts: 41
Joined: 17 Mar 2015, 14:19
Location: 127.0.0.1

Re: Multipart - Create form-data for http request

13 Mar 2016, 15:28

Hi tmplinshi,

Sorry to bump this old topic but i need your help please. I'm trying to upload files using your method but i can"t manage it :\

Here is my post where i explain my issue.

Perhaps you are more skilled than me and you can manage it better :)

Thank you in advance, regards.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Multipart - Create form-data for http request

14 Mar 2016, 05:06

Hello Peace1,

Please try the new version CreateFormData(), which support AHK Unicode. Let me know if you encounter any issue.
User avatar
Peace1
Posts: 41
Joined: 17 Mar 2015, 14:19
Location: 127.0.0.1

Re: Multipart - Create form-data for http request

14 Mar 2016, 05:34

tmplinshi wrote:Hello Peace1,

Please try the new version CreateFormData(), which support AHK Unicode. Let me know if you encounter any issue.
Hi tmplinshi,

Thank you for the link, i'm trying to understand how i can do it but i'm not very skilled with HTTP Request and Headers. I know how to post and create Ticket for my project using AHK code but for upload file is little hard for me.

Can you try it for me, please ?

Regards.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 226 guests