zendframework / zend-diactoros

PSR-7 HTTP Message implementation
BSD 3-Clause "New" or "Revised" License
1.55k stars 152 forks source link

Invalid size provided for UploadedFile; must be an int. #316

Open ImmanuelKannan opened 6 years ago

ImmanuelKannan commented 6 years ago

Hi guys, I'm working on an iOS project and I'm required to send documents, such as pdfs, to my laravel server. The issue is, every time I try to send a post request for a PDF, I get this error message: Invalid size provided for UploadedFile; must be an int. I'm at my wit's end trying to solve this issue. Any ideas?

Xerkus commented 6 years ago

That exception is thrown here https://github.com/zendframework/zend-diactoros/blob/167607290e79c396fd947cedeadccce0173c0e47/src/UploadedFile.php#L113-L115

That is all I can derive from the description, you need to be more specific. Stack traces, anything?

Xerkus commented 6 years ago

If laravel uses ServerRequestFactory to create request from php globals, try to do var_dump($_FILES); exit; with failing request and post result here

mtnaghibi commented 6 years ago

Increase upload_max_filesize in php.ini

;Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 16M

Then Restart Apache

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-diactoros; a new issue has been opened at https://github.com/laminas/laminas-diactoros/issues/10.