Laravel 5.2 uploaded images are broken - php

I'm doing an app in Laravel 5.2 where I can upload users pictures to public on their own profiles.
Thing is, when a move the file to destination path, file is created but content is missing because I cannot open it.
I share a screenshot with the code and the imagen from windows explorer...
Any advice?

Well, finally I got fix the problem but couldn't use Input class from Laravel, should use GD Library to get move correctly the image.

Related

laravel uploads images but doesn't show theme

I designed a web app by Laravel and deployed it on IIS windows server 2022.
this app uploads images correctly but it can't show them.
when I open the security tab on properties of uploaded images I see IISUSER doesn't exist in the permissions list. I change the permission list and add IISUSER to it and everything is ok. what should I do to resolve it?
laravel stores images in public folder only and not store in nested folders, so instead of storing image in public images\folder1\folder2\image.png you can directly store public folder/image.png in this way
try to move file something like this
path= $actuFile->move(public_path('folder'), $name);
and retrieve something like this
(asset("folder/{$imagName}")
This is worked for me.
if its work for you also then welcome in advance.
I solved the problem.
Php first uploads files to c:/windows/Temp then move them to laravel/public/uploadedFiles. I modified the permissions of the Temp folder and add IISUSER to the list. after that, I set full control permission to the IISUSER.

File upload in codeigniter in shortcut folder

This is not the first time I am doing file upload using CI. However in this particular case I want to upload images or files to shortcut folder created at project root. This is what my project root looks like in following image:
So basically what I had been trying to do is using php filesystem function is_dir('goku') (goku is shortcut folder as shown in above image that links to C:\Users\Name\Desktop) and if true then create a sub-folder inside it and insert the image or file in that sub-folder. However I didn't find any way to make the shortcut folder recognize as directory and returns file upload error -The upload path does not appear to be valid. Upload works fine on other folder. I know that php is not recognizing the shortcut folder as directory because on running is_dir('goku') returns false. I have gone through all probable solutions but now again back to where I started. Any helpful hints regarding this is highly appreciated. Thank You!!!
Using the library Codeigniter
library upload single file and multi file
Easily upload .

Tinymce justbioil image not uploading in codeigniter

I am using justboil plugin in tinymce for image uploading. I am having an issue with image uploading, When I upload image it got stuck on “Upload in progress” message. In network tab(console) error is “The Upload process had not started, or started, but had not finished yet, or your browser could not reach the remote server.”. It was working fine before yesterday but now it is not working. Upload function of controller Uploader is also not working if I access it directly through URL.
I have thoroughly read http://justboil.me/ and How to fix Jbimages plugin for Tinymce 3.x not uploading image but found no answer.
Can anybody please help me with this.
Thanks in advance.
Atlast I found solution to this problem accidentally. I just remove controller name from URL while calling upload function and set uploader controller as default controller in routes.php. Now its working fine

Getting a 404 on images uploaded using FTP in Magento

I have recently installed Magento and am using it for the first time. I am trying to uplaod an image to a folder as the new logo in the heading. When I upload the image using FTP the file uploads successfully but I can’t see it in the folder listing in a browser or on the website or if I visit the url for the image. I get a 404 page instead. Everything is getting cached I believe. I have turned off caching in the back end and cleaned out var/cache folder. This is a new one to me as I wouldn’t ahve thoughts ftp uploading an image would or could be cached? I can’t even change the header image on my website.
Im using the hellowired them as a starting point.
Cheers
Check the permissions on the Images and the directory it is in.
Can you verify that it is in the folder that you have uploaded it too?
Can you view it on server browsing the directories?
Finally check that you have type it correctly as Linux box's are CAPS sensitive, this could be why you can't see it also.
Looks like my host migrated my accounts to another server and I was actually updating the old hosting. Thanks for your help.

Uploading multiple images in SilverStripe 3.0

I'm using SilverStripe 3.0 and I need some help around here. I have a many to one relation between pages and images (I'm creating an image gallery). The images are uploaded into the right folder, but the CMS seems to save the wrong path for them. I'll explain a little more detailed:
I load the image in the uploader, it shows me a thumbnail while uploading. But when it finishes the upload the thumbnail disappears.
When I click the Edit button I see that it's looking for the image in the /assets folder (like /assets/picture.jpg), but it was uploaded to /assets/Uploads.
I tried setting a different upload folder using $FileField->setFolderName(), but it always looks for the images in /assets besides it uploads them in the right folder.
Any suggestion?
This was a known bug that should be fixed with the 3.0.4/3.0.5 release.

Categories