Image upload internal server error 500 only for iphone - php

The image is getting uploaded from android to server but the image is not getting uploaded from iphone to server. I am getting internal server error for iphone even i cant upload 2kb file too.

Check your web server access log and error log files to identify the specific error.

Check your file path properly. May be issue raise because of that.

I changed the image uploading type to base 64 i.e, I asked iphone developers to encode the stream of bytes with base 64 and then I handled with base 64 decode and storing the file. It worked in the emulator but while using in the iphone it showed page not found error and then we compressed the image size by decreasing the image resolution and its working now.

Related

Laravel 8.38 validation issue, max file size. RuntimeException: The file {public path} cannot be opened. in file Psr17Factory.php on line 46

Created the file validation as (for test purpose it is 5kb)
'file': "max:5|mimes:jpg,png,jpeg,pdf,txt,doc,docx,mp4"
There is a weird issue, as it is displaying a valid error on uploading png
...may not be greater than 5 kilobytes.
but on uploading mp4 it is throwing following error
RuntimeException: The file {path-here}\public cannot be opened. in file
{path-here}\vendor\nyholm\psr7\src\Factory\Psr17Factory.php on line 46
Open icons tray on right side of your windows.
left click on wamp icon.
click on PHP > PHP Settings > upload_max_filesize = (set the size to max 256 MB).
You can also edit it in php.ini file in C:\wamp64\bin\apache\apache2.4.37\bin\php.ini
click here for image
I was having same error when sending file via postman to server with Laragon(not wamp/xampp) tried setting up my upload_max_file but couldn't find luck. In the end, Running Laragon with Run as Administrator did work.

How can I solve "This page isn’t working" when upload image?

When I upload a image with 1.05 MB, there is no error.
But when I upload a image with 2.36 MB and then I submit it, I'm getting the following error:
This page isn’t working
myshop.dev is currently unable to handle this request.
HTTP ERROR 500
Whereas in php.ini, I had set it like this :
upload_max_filesize=10M
post_max_size=10M
How can I solve this problem?

Laravel Intervention NotReadableException "Image source not readable" only on staging server

I'm developing a Laravel application that makes use of the Intervention Image Library. After successfully developing an image upload system, I encountered a problem on the staging server. When I upload an image, I get the following exception:
NotReadableException in AbstractDecoder.php line 302:
Image source not readable
in AbstractDecoder.php line 302
at AbstractDecoder->init('/var/www/yoosit.com/public') in AbstractDriver.php line 64
at AbstractDriver->init('/var/www/yoosit.com/public') in ImageManager.php line 50
at ImageManager->make('/var/www/yoosit.com/public') in ImageManagerStatic.php line 57
at ImageManagerStatic::make('/var/www/yoosit.com/public') in ImageController.php line 90
at ImageController->upload(object(UploadImageRequest))
Here is the code where stuff goes wrong:
$images = $request->only('image_1','image_2','image_3','image_4','image_5',
'image_6','image_7','image_8','image_9','image_10');
foreach($images as $key => $image)
{
// Continue loop if image input is empty.
if ($image === null)
{
continue;
}
$interventionImage = InterventionImage::make($request->file($key)->getRealPath());
The exception is thrown when the last line where the instance is made is executed. I find this very odd because in my local environment (Homestead), I can upload images just fine.
I've already checked permissions and the folder is definitely writable. I'm running Debian 7 on a DigitalOcean VPS.
Any ideas?
Thanks in advance!
P.S. I'm the static call to InterventionImage is just Intervention, normally it's Image::make but I save information about images to my database so I already have a model with the same name.
Have you checked that the images are actually uploaded? It could be for instance that your staging environment doesn't allow the upload size.
I had the same problem, everything worked fine on my local server, but when deploying in DigitalOcean I received the same message, I solved it by creating the symbolic link with php artisan storage: link in your DigitalOcean Project.
That solved it. You can check it in the documentation. https://laravel.com/docs/5.7/filesystem

bluimp library. Getting a mysql error

Bluimp and PHP
Iam using the bluimp upload library to upload my CSV files which have huge data and after upload the data will be inserted into the database. Iam trying to upload like 10 files at a time. And this gives me a error.
xampp is killed and getting the error
"mysqli_connect(): (HY000/2002): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."
I observed that bluimp is trying to upload 6 files at a time. How to make it process 1 file at a time.

Unable to open for writing: File too large

I am getting this error. What does it mean?
Warning: imagejpeg(): Unable to open
'/home/content/59/.../images/___htmlthumbnail_0b1292bbbcc4199eb4f50651962cf4641329752862.jpg'
for writing: File too large in
/home/content/59/.../cms/classes/resize.class.php on line 50
This is what happens.
Big image is uploaded
Big image - if too big - is resized to
the correct dimensions.
4 thumbnails are created.
Step 1 is working fine. The main image is being uploaded. The problem is coming with creating the thumbnails. The script is failing here.
imagejpeg($this->image,$filename,$compression);
This error is only happening on one server. We deploy our script to hundreds of servers a year. I just cannot find out what this error means. The file is uploading fine so I don't see why it is too large. If the server was running out of memory it would have a memory error surely.
The image I am uploading isn't even particularly big. Its 33KB. 780 x 120px.
Has anyone seen this error before? I assume something server side needs to be adjusted as the script works just fine every where else.
check php.ini settings... if you don't have the access contact the support i'm sure they will help you out...

Categories