GithubHelp home page GithubHelp logo

cloudder's People

Contributors

bjohanning avatar clemblanco avatar joseraul avatar jrm2k6 avatar markeilander avatar mikeaag avatar osbre avatar pixel-penguin avatar rogervila avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudder's Issues

Not working for Lumen (5.4)

I know that the documentation in this repo says it works for Laravel 5. That said, I was trying to use this in a Lumen 5.4 project and fails when trying to register the service provider:

Fatal error: Call to undefined method Laravel\Lumen\Application::share() in /var/www/nike/vendor/jrm2k6/cloudder/src/JD/Cloudder/CloudderServiceProvider.php on line 41

this is exactly at:

    public function register()
    {
        $this->app['cloudder'] = $this->app->share(function ($app) {
            return new CloudinaryWrapper($app['config'], new Cloudinary, new Cloudinary\Uploader, new Cloudinary\Api);
        });
    }

Any ideas if that app->share() can be changed to something else?

Thanks!

How to add the multiple files upload option

Hi, I've implemented your wrapper and tested it for the last days and I love it. I have only one question and is how to add the "multiple files upload" feature?. I've read the documentation and it mention the $options array to add additional features, but in this case how could I do it?

Thanks

Must Supply API KEY

I am experiencing an issue reported in another thread and the solutions listed there do not seem to solve. Kindly offer any assistance you may have on how to resolve this issue.

screenshot from 2018-09-13 04 55 02

Questions about adding features

I'm really loving your Cloudder lib, and I'll be using it for a few of our corporate projects. One thing I want to add is a specified base url for uploads, so that all files, by default, get uploaded to a subdirectory in cloudinary (for example, I could specify CLOUDINARY_BASE_UPLOAD_URL=/marketing/ to upload all pictures to a marketing folder on cloudinary.

Similarly, I'd like to also implement CLOUDINARY_TAGS_ON_UPLOAD, which would specify a list of tags applied to all uploads - of course, more could be specified on each individual one, but in my case, I could - for example - add marketingmedia tag to all uploads without specifying it.

Are those things you'd accept a PR for if I implemented them in the main library, or should I just implement my own simple wrapper?

Fallback if not found on Cloudinary

Is there a way to have a fallback if 404 on Cloudinary?

AFAIK Cloudinary class will just generate the full URL, not make any request to check if the resource is available.

However, I'd like to have a fallback if the remote image is not found so I can display the local version of it. Unfortunately, this might imply making an extra request per image and will consume more bandwidth.

What do you think?

How to resize image

I created this function

Cloudder::upload($image, $path, array("width"=>150, "height"=>150, "crop"=>"scale") );

But it not work

problem in loading pdf

i want to display the pdf file that i uploaded to cloudinary server.but it is always showing png file.how can i read pdf file.

Cannot delete file with the delete() method

i am unable to delete files using the methods provided. Here is my code:

Cloudder::delete($publicId, null);

Or

Cloudder::delete($publicId, array('folder' => 'users/'));

no error but when i check my dashboard file is still there.

secureShow returning scaled image instead of original uri with versioning

Hi,
why does secureShow() return '/image/upload/c_fit,h_150,w_150/myImage1.png' instead of '/image/upload/v1550480678/myImage1.jpg'
The second link, I get from opening the cloudinary console directly.
I ran php artisan vendor:publish --provider="JD\Cloudder\CloudderServiceProvider" and
I have commented out the scaling in my config/cloudder.php, so the returned url is : '/image/upload/myImage1'
So then, how to include the versioning on the returned result?
Thanks

Error While Uploading Audio

Hey guys, am having issue uploading audio to Cloudinary. I use the Method bleow

$file = $request->file('file')->getRealPath();

Cloudder::upload($file, null, ['resource_type' => 'video']);

$song_url = Cloudder::secureShow(Cloudder::getPublicId());

// the value of $song_url == "https://res.cloudinary.com/mad237/image/upload/c_fit,h_150,w_150/tqgd6r6jpquhqq5hbmua.png"

Please i need your help the file am uploading is an audio file.

Invalid Signature 759f5facc60f4b021d18b806ce79756a924321ed. String to sign - 'public_id={\"0\"=>\"60\", \"1\"=>\"

Hi there,

I keep getting this issue when trying to upload.
All configurations are set and cross-checked.

this is a sample of my code
public function test (Request $request) { if ($request->hasFile('file')) { \Cloudder::upload($request->file('file'), ["timeout" => 60, "folder" => "folder"]); $c=\Cloudder::getResult(); if($c){ return $c['url']; return back() ->with('success','You have successfully upload images.') ->with('image',$c['url']); } } else { return 'false'; } }

Invalid Signature when trying to upload

Hello there, im following this guide to upload an image to Cloudinary through your wrapper, but i cant figure it out why am i getthing this error:

Cloudinary \ Error (401)
Invalid Signature 5cdab5056b3a64970e330834c0bd3288dea25a8b. String to sign - 'timestamp=1516097941'.

Any suggestions how i can solve this?

Below you can find the complete code of what im executing right now that is giving me that error.

Route

 Route::post('/upload-image',[
    'uses' => 'CloudderController@uploadFile',
    'as' => 'upload'
 ]);

Controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class CloudderController extends Controller
{
    public function getFile(){        
        return view('welcome');
    }
    public function uploadFile(Request $request){
        
          if($request->hasFile('input_img')){  
            \Cloudder::upload($request->file('input_img'));
            $c=\Cloudder::getResult();             
            if($c){
               return back()
                    ->with('success','You have successfully upload images.')
                    ->with('image',$c['url']);
            }
            
        }
    }
}

Web form

<form action="{{route('upload') }}" method="post" enctype="multipart/form-data">
    <input type="hidden" value="{{ csrf_token() }}" name="_token">
    <label>Select image to upload:</label>
    <input type="file" name="input_img" id="input_img">
    <input type="submit" value="Upload" name="submit">
    
</form>

Thank you, Afterspace

Upload to specific folder

Good day,
Please, how can i upload to a specific folder on cloudinary. For example, if i have a folder name banners, how can i upload images directly from my laravel code to banners folder? Thanks

Folder Creation on upload

As title, how do you create a folder (with name) on upload.
E.g. /profiles/{user}/avatar/{avatar}.jpg

Update documentation

Could you move the

vendor:publish

below

Add the following in config/app.php:

Because vendor:publish will not work until the façade is added to config/app.php

Cloudder::upload Returns Empty Json

I used the function Cloudder::upload in php and intended to return it and get the url of the image, It responded with the json of an empty api.
Note: the image is successfully saved in cloudinary

capture

capture2

now I know there is a workaround by calling secureShow method, just wanted to make sure if it is possible to return the upload function right away

Full API support

Hello, I want to list all resources from Cloudinary.

I have seen that this method is not declared in CloudinaryWrapper. If you agree, I'd like to add all the API endpoints to the wrapper.

Also, in order to make it simple, I'd follow the same API names in camel case.

For example, destroyImages method is calling delete_resources from api. I'd change the name to deleteResources (of course I'd mantain the current method names as an alias in order to keep compatibility)

If you agree I can make the PR. Thank you very much for this package.

Adding secure => true globally

Just wondering if there's a way to add secure => true to the options array globaly so that all requests are made using HTTPS? If not, would it be possible to add this in? Happy to submit a PR.

Must supply api_key

Hi Jeremy,

I'm getting error:
InvalidArgumentException in Cloudinary.php line 648:
Must supply api_key

I have all keys in .inv file and in config/cloudder.php

I go over your file and cannot get how you populate self:config?

maybe the issue is here:
public static function reset_config() {
self::config_from_url(getenv("CLOUDINARY_URL"));
}
what is CLOUDINARY_URL? I don't have it.

Error while uploading video

Hi, I have this package implemented in my Laravel Application (Laravel 5.7.25) and the image upload is working well but the Video upload is not working for me. The following is my image upload code which works perfectly:

$id = Auth::user()->id;
$name = $request->input('name');
$email = $request->input('email');
$about = $request->input('about');
$profile_picture = $request->file('profile_picture')->getRealPath();

Cloudder::upload($profile_picture, null);

list($width, $height) = getimagesize($profile_picture);

$image_url = Cloudder::show(Cloudder::getPublicId(), ["width" => $width, "height"=>$height]);

$data = array('name' => $name,'email' => $email,'about' => $about,'profile_picture' => $image_url);

User::where('id', $id)->update($data);

return redirect('/dashboard')->with('response','Profile Updated Succesfully!');

The following is my video upload code which returns the following error: Error in sending request to server - read function returned funny value

    $user_id = Auth::user()->id;
    $video_title = $request->input('video_title');
    $video_description = $request->input('video_description');
    $video_url = $request->file('video_url')->getRealPath();

    Cloudder::uploadVideo($video_url, null);

    $vid_url = Cloudder::show(Cloudder::getPublicId());

    $data = array('user_id' => $user_id, 'video_title' => $video_title, 'video_description' => $video_description, 'video_url' => $vid_url);

    VideoResume::save($data);

    return redirect('/my-video-resumes')->with('response','Profile Published Succesfully!');

Any assistance in figuring out the issue will highly be appreciated. Thanks.

Laravel 5.4 Compatibility

2 errors on update:

Warning: Ambiguous class resolution, "Cloudinary\Akamai" was found in both "vendor/cloudinary/cloudinary_php/src/Akamai.php" and "vendor/cloudinary/cloudinary_php/src/Cloudinary/Akamai.php", the first will be used.
> post-update-cmd: php artisan optimize                           
  [Symfony\Component\Debug\Exception\FatalThrowableError]              
  Call to undefined method Illuminate\Foundation\Application::share()  
  Script php artisan optimize handling the post-update-cmd event returned with error code 1

can't catch exception while uploading file

I am trying
try{
Cloudder::upload($request->file('profile_picture'),
null,
array("format" => "jpg", "crop" => "crop", "x" => 0, "y" => 0, "width" => 200, "height" => 200,"crop" => "thumb", "gravity" => "face", )
);
}
catch(Exception $e){
return 'invalid';
}

i am trying to upload a invalid file (abc.txt) so it must come in catch but i get HTTP/1.1 500 Internal Server Error

JD\Cloudder\CloudderServiceProvider not found issue.

I face below problem in terminal when i run

Run php artisan vendor:publish --provider="JD\Cloudder\CloudderServiceProvider"

Command. Please Help me on this.

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'JD\Cloudder\CloudderServiceProvider' not found

On the fly transformations

Hi @jrm2k6 please is it possible to achieve on the fly (OTF) transformation using this package? If yes, can you provide an example on how to? Thanks so much

Must supply api_key Laravel

Hello I'm trying to do something like :
Cloudder::upload($filename);
$c=Cloudder::getResult();
dd($c);

in my controller but I get error message "Must supply api_key", I don't get where the problem came from, I specified my api key, my secret api and the cloud name.. Can I get any help please?

Disable Scaling (Or set height to auto)

Hi!
the default scaling is

'scaling'    => [
        'format' => 'png',
        'width'  => 150,
        'height' => 150,
        'crop'   => 'fit',
        'effect' => null
    ],

So when I want to show an image - using Cloudder::show() -, it will take these default values unless I change them in each photo show command.

But sometimes I don't know the height or the width. I need to make them = auto to solve this problem.

How can I do that?

Thanks !

est

etettetete

Unknown API key

I'm receiving an Unknown API key error upon trying to upload.

Cloudder::upload("/var/www/laravel/test-images/Clear_1.png", "RAND-" . mt_rand(1000,9999), array(), array('tag1','tag2'));
(1/1) ErrorUnknown API key `REDACTED`
--
in Uploader.php (line 344)
at Uploader::call_api('upload', array('timestamp' => 1500481508, 'public_id' => 'RAND-8820', 'tags' => 'tag1,tag2', 'signature' => '6e07ace689cf36b7fa03b3ebefa2346ca1cd010d', 'api_key' => '`REDACTED`'), array('public_id' => 'RAND-8820', 'tags' => array('tag1', 'tag2')), '/var/www/laravel/test-images/Clear_1.png')in Uploader.php (line 63)
at Uploader::upload('/var/www/laravel/test-images/Clear_1.png', array('public_id' => 'RAND-8820', 'tags' => array('tag1', 'tag2')))in CloudinaryWrapper.php (line 122)
at CloudinaryWrapper->upload('/var/www/laravel/test-images/Clear_1.png', 'RAND-8820', array(), array('tag1', 'tag2'))in Facade.php (line 221)

[...]

I have it properly defined in my .env file, and REDACTED is properly showing my API key as found in the dashboard.

Show method not working for HTTPS

Hi There,

There seems to be an issue with the show method handling secure URLs. The website has an SSL certificate installed and everything is working, but the images served up by Cloudinary using this package aren't loading with a secure URL.

I've tried to force the URL within config/cloudder.php and also within the .env file setting the CLOUDINARY_BASE_URL to use HTTPS.

Please let me know if I've missed something.

Thank you,
Kris

Video upload

This is not an issue per say. I was just wondering how video upload would be implemented, it was not mentioned in the README. In my application, i had two file uploaders, one for image upload and the other for video upload. Whenever i try to do both uploads at the same time, i get token mismatch exception but when i do an image upload only it works just fine. I am surely missing out on something, would could that be???

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.