matriphe / laravel-imageupload Goto Github PK
View Code? Open in Web Editor NEWUpload image using Laravel's build in function and resize it automatically.
License: MIT License
Upload image using Laravel's build in function and resize it automatically.
License: MIT License
Hello , when using
Imageupload::upload($a, $b, $path)
The $path always ignores the last folder
Example : $path = "profiles/profile-test/" will save the image to profiles folder , if you add "/anything/" then it will save to /profiles/profile-test/.
Hi. I want my files to be 1000 x 700 but keeps different widht & height for every image which i do not want. Can you add this functionality in it also. If it already has that functionality then can you tell how can we do that.
Thanks in advance
Steps Reproducing the bug:
composer require "matriphe/imageupload"
[ERROR] Error Message:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::share()
I used your awesome upload module to upload images.
composer.json require
"matriphe/imageupload": "5.*"
form
<input type="file" class="form-control" name="image" accept="image/gif, image/jpeg, image/png">
controller
if ($request->hasFile('image')) {
Log::debug('Upload images: '.$post->id);
Imageupload::upload($request->file('image'), $post->id);
}
config
'newfilename' => 'custom',
However I couldn't upload the following image:
I don't know why.
I can upload jpeg, jpg, png, gif files without problems.
weird
I want to delete images when delete row product, this library is not supported?
Hi
If i set s3_enabled = false and 'output' => env('IMAGEUPLOAD_OUTPUT', 'db') the system is still trying to use the s3_url ... so when uploading i get:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'home_listing_s3_url' in 'where clause'
thanks
Hi this is a really simple and nice package... i am using this package with my projects. i wan to know is it working with 5.3?
When you choose for 'newfilename' => 'custom'
in the config and you don't fill in a new filename on the Imageupload::upload()
so it falls back on the default, the file gets an double extension because $this->results['original_filename']
already contains the $this->results['original_extension']
.
In Imageupload.php
on line 86 $this->results['original_extension']
should be removed at the end of the line.
I am trying to upload using this package but getting this error.
**Non-static method Matriphe\Imageupload\Imageupload::upload() should not be called statically**
i check the core class Imageupload and i didn't find any static method while in the documentation every example used as static method.
Note: I am using laravel 5.6
Laravel 5.2 is now the latest.
Could you please update the composer file?
Thank you!
After updating to the latest library (we were on a version that was a few months old) we noticed that resized images are not being saved. Only the original was being saved even and nothing had changed in our code.
Traced this to no "save()" call in the resized image function.
Opened a PR to fix this #18
Let me know if there is a something wrong on my end and if resized images are being saved for others. Thanks!
Hi ,
This is realy a nice package which handles images very well. i want to maintain aspect ratio of images is this possible with this package?
ย
how this can be fixed?
Laravel 5.4, PHP 7.1
Does anybody knows why is this happening?
FileNotFoundException in MimeTypeGuesser.php line 123:
The file "" does not exist
I'm trying to upload an image with this:
. . . //in PHP function //create new image if (!empty($data['image'])) { //var_dump($data); $imageUpload = Imageupload::upload($data['image'], null, 'uploads/images/'); $data['image'] = $imageUpload['filename']; } . . .Hi
is it possible to get valid size and format of uploaded files from config/imageupload.php? how?
otherwise how can i add it to following piece of code?
if (Request::hasFile('file')) { $result = Imageupload::upload(Request::file('file')); }
for example if file is photo max upload size set to 2mb or if file is zip max upload size change to 30mb
Hey,
grat package, it is however coming with a big security hole. You need to implement a check that makes sure that it is indeed an image, if not reject it, don't even store it.
Best regards
Hi i am trying to integrate this in my project but it is throwing error.
FatalThrowableError in ImageuploadServiceProvider.php line 25: Call to undefined method Illuminate\Foundation\Application::share()
Can you please update the library composer requirements for illuminate/support up to 5.1?
Not sure if it's tested, but supposedly 5.1 isn't a breaking release. It's LTS too, so it'd be worth it to make the library for that version. Thanks for the image uploading goodness!
hi
i want to rename exist files but my code not working!
Imageupload::upload($filesource, $newfilename, $dir) =>
$name is new name but it doesnt work: :(
$data['result'] = Imageupload::upload($request->file('file'),$name,'/3');
please help me. its my code:
if ($request->hasFile('file')) {
echo $filename = $_SERVER['DOCUMENT_ROOT'].'/tebray/files/3/'.$request->file->getClientOriginalName();
if (file_exists($filename)) {
$orgname = $request->file->getClientOriginalName();
$temp = explode(".", $orgname);
$name = $temp[0].'-c'. '.' . end($temp);
echo "exist: ".$name;
}else {
$name = $request->file->getClientOriginalName();
echo "no exist: ".$name;
}
$data['result'] = Imageupload::upload($request->file('file'),$name,'/3');
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.