Sergi Juanola
Sergi Juanola

Reputation: 6647

base64 encoded image isn't being sent by POST

I have a couple of image drop places made with html5. When the image is parsed and converted to data (and encoded in base64), I grab that data and send via post to a php file.

On localhost, that base64 string is received perfectly in the php file. However, when I move to a server, both image preprocessing and base64 sending to the server work (I read the headers), but when in the php file, that base64 string is no longer there. Is there anything I am missing?

Some extra information:

Breaking news

I tried to upload 600kb of data. Now the server prompts this:

<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/altmail/admin/calls/ajax.previewnewsletter.php<br />
does not allow request data with POST requests, or the amount of data provided in
the request exceeds the capacity limit.
</body></html>

Again, post_max_size is big enough.

Breaking news 2

After uploading the opposite, a 38x38, 220bytes picture, it uploaded correctly.

Upvotes: 0

Views: 4805

Answers (2)

tamat
tamat

Reputation: 316

Check the Apache Request size limits:

http://httpd.apache.org/docs/2.2/mod/core.html#LimitRequestFieldSize

There is a limit in the size of everything where it comes to HTTP, so if something works here and not there, increase the sizes there. ;)

Upvotes: 2

Korvo
Korvo

Reputation: 9724

You're saving the base64 data into a file? If so maybe the folder is not marked for "WRITE", check that.

You are using $_POST or is using global variables in Localhost. If you are using Global change to $_POST.

If you are using RAW, use the variable like this: $_GLOBALS['HTTP_RAW_POST_DATA']

Upvotes: 0

Related Questions