Can I use the POST function to upload a PDF file?

Avatar

Avatar
Level 1
chrisa99770153
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
chrisa99770153
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
View profile
chrisa99770153
Level 1

30-08-2019

I need a little help. My goal is to upload a PDF file to a URL and read the HTML response from the server. Is it possible to do this using the post function?

Post(UploadUrl.rawValue,"C:\Users\myFile.pdf","application/pdf")

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Level 1
chrisa99770153
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
chrisa99770153
Level 1

Likes

0 likes

Total Posts

6 posts

Correct reply

0 solutions
View profile
chrisa99770153
Level 1

31-08-2019

Mayank, thanks for your quick response. Maybe you can help with syntax for the post function. Currently, I am getting no response from the server when using the post function but when testing the put function I get an error that indicates the put function was not accepted by the server. I can make successful file uploads using a simple HTML form that has the post method enctype of multipart/form-data.

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

30-08-2019

Try using URL function(Page 105) to make a post-call and read the response:

https://helpx.adobe.com/pdf/aem-forms/6-2/formcalc-reference.pdf

A sample get request looks like this:

var url = "https://jsonplaceholder.typicode.com/todos/1";

TextField1.rawValue = Get(url);

Thanks!