1

Actually, I wanna send a high resolution image to PHP. I'm sure that the data have been captured, because when I use

$img=file_get_contents("php://input"); $myfile = fopen("test.txt", "w"); fwrite($myfile,$img); fclose($myfile);

I can see data in test.txt file. And the test.txt file looks like the bellowing one: enter image description here

No matter the size of my image, I can get the data I want in test.txt.
Everything is fine when image's size is in a normal range like 2MB, and I can save the image locally. But the problem is when my image is too large nothing can be gotten. I use $_POST in PHP like bellowing.

$img = $_POST["hidden_data"]; $board_company = $_POST["cbname"];

Is it because the data is so large that PHP does not have the ability to find anything? It's weird.

EDIT1:

Should I always save data as txt and then get what I what from the txt file? It's a little stupid. Incidentally, I have modified post_max_size=100M.

魏嘉毅
  • 109
  • 1
  • 8
  • Maybe related: [What is the size limit of a post request?](https://stackoverflow.com/questions/2364840/what-is-the-size-limit-of-a-post-request) – Mikey Jul 06 '17 at 14:41
  • @Mikey Thanks for your help~ But I think I can post all data to PHP because I can write all data in **.txt** file, the problem is on PHP's side I believe. Additionally, I have already set `post_max_size = 100M`. Still thank you~ – 魏嘉毅 Jul 06 '17 at 14:52

0 Answers0