• Purchasing a license grants permission to use the software and to get Tech Support. A license purchase doesn't grant customization support.

API Upload Error

anotherp

Network license
License owner
Joined
Jun 23, 2015
Messages
21
Points
53
Location
Baltimore, MD
So I am using a code I found on another thread that I am currently having issues locating.

Here is the code I am using:

Code:
<form method="POST" action="http://picgur.org/api/1/upload">
    <input type="hidden" name="key" value="0a65553c54cf72127d11281f96518469" />
    <input type="file" name="source" />
    <input type="submit"></input>
</form>
And here is the page for the test: http://www.picgur.org/thing.html

When I choose and image and hit upload I get this error:
Code:
{"status_code":400,"error":{"message":"Invalid base64 string.","code":120,"context":"Exception"},"status_txt":"Bad Request"}
Not sure what I am doing wrong.
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
15,522
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
You are missing enctype="multipart/form-data"

Code:
<form method="POST" action="http://picgur.org/api/1/upload" enctype="multipart/form-data">
    <input type="hidden" name="key" value="0a65553c54cf72127d11281f96518469" />
    <input type="file" name="source" />
    <input type="submit"></input>
</form>
 

anotherp

Network license
License owner
Joined
Jun 23, 2015
Messages
21
Points
53
Location
Baltimore, MD
Excellent! The form now does post the image uploaded. However, after upload it forwards you to this information:


Any way you could save me some googling and show me how to redirect to a set page after upload?
More precisely, I would like it to forward to the Image Page for the new upload.

Thanks again.
 

anotherp

Network license
License owner
Joined
Jun 23, 2015
Messages
21
Points
53
Location
Baltimore, MD
I could kiss you Rodolfo!
Working exactly as I wanted. I cannot say enough good things about You, Chevereto and the whole community!
 
  • Like
Reactions: Rodolfo