Giter VIP home page Giter VIP logo

laradrop's People

Contributors

aurelijussaldauskas avatar jasekz avatar olegdemkiv avatar phpner avatar vikashsp 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laradrop's Issues

Display Folder Images on Page Load

Hey Zig, Zig here :)

Could you advise me on how to have a specific folder loaded into the containers.
I've looked through laradrop.js but cannot find my way in there so well.
Also, browser inspectors show no event lisetner bound to the folder image (the image you click to show the images inside.)

I'd like to be able to offer a link so that the containers load a specific folder - meaning the images inside the folder, as if the folder had been clicked to view the contents.

I apologise if this is a trivial matter, I just figured you are helpfull and are in the best poition to give advice on this.

Thanks :)

How do I show the actual progress of the file upload?

Hello,

On the live demo, the upload progress bar seems to be consistent with the upload progress of the file, however, on my setup, the progress bar extends to the end immediately the "start upload" button is clicked.

I followed the instructions on the repo.

Please is there any extra settings to be made to show the actual progress of the file upload?

Boot method error

Adding this package via composer throws the following error.

Declaration of Jasekz\Laradrop\LaradropServiceProvider::boot(Illuminate\Contracts\Events\Dispatcher $events) should be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot()

Over Riding Laradrops Controller still calls Laradrops Controller

I have made a new controller like this

<?php 

use Jasekz\Laradrop\Http\Controllers\LaradropController;
use Input, Auth;

class UserMediaController extends LaradropController {
    
    /**
     * Upload and store new file.
     *
     * @return JsonResponse
     */
    public function store()
    {
        try {
          
            if (! Request::hasFile('file')) {
                throw new Exception(trans('err.fileNotProvided'));
            }
            
            if( ! Request::file('file')->isValid()) {
                throw new Exception(trans('err.invalidFile'));
            }
            
            /*
             * move file to temp location
             */
            $fileExt = Input::file('file')->getClientOriginalExtension();
            $fileName = str_replace('.' . $fileExt, '', Input::file('file')->getClientOriginalName()) . '-' . date('Ymdhis');
            $mimeType = Request::file('file')->getMimeType();
            $tmpStorage = storage_path();
            $movedFileName = $fileName . '.' . $fileExt;
            $fileSize = Input::file('file')->getSize();

            if($fileSize > ( (int) config('laradrop.max_upload_size') * 1000000) ) {
                throw new Exception(trans('err.invalidFileSize'));
            }
            
            Request::file('file')->move($tmpStorage, $movedFileName);
            
            $disk = Storage::disk(config('laradrop.disk'));

            /*
             * create thumbnail if needed
             */
            $fileData['has_thumbnail'] = 0;
            if ($fileSize <= ( (int) config('laradrop.max_thumbnail_size') * 1000000) && in_array($fileExt, ['jpg', 'jpeg', 'png', 'gif'])) {

                $thumbDims = config('laradrop.thumb_dimensions');
                $img = Image::make($tmpStorage . '/' . $movedFileName);
                $img->resize($thumbDims['width'], $thumbDims['height']);
                $img->save($tmpStorage . '/_thumb_' . $movedFileName);

                // move thumbnail to final location
                $disk->put('_thumb_' . $movedFileName, fopen($tmpStorage . '/_thumb_' . $movedFileName, 'r+'));
                File::delete($tmpStorage . '/_thumb_' . $movedFileName);                
                $fileData['has_thumbnail'] = 1;
                
            } 

            /*
             * move uploaded file to final location
             */
            $disk->put($movedFileName, fopen($tmpStorage . '/' . $movedFileName, 'r+'));
            File::delete($tmpStorage . '/' . $movedFileName);
            
            /*
             * save in db
             */

            if (!Auth::user()->currentTeam()){
            $eitherTeamOrUser = \Auth::user()->finduser;
            }

            elseif(Auth::user()->currentTeam()){
                $eitherTeamOrUser = \Auth::user()->currentTeam()->findteam;
            }
            $fileData['findimage'] = 1;       
            $fileData['filename'] = $movedFileName;  
            $fileData['alias'] = Input::file('file')->getClientOriginalName();
            $fileData['public_resource_url'] = config('laradrop.disk_public_url') . '/' . $movedFileName;
            $fileData['type'] = $fileExt;
            if(Input::get('pid') > 0) {
                $fileData['parent_id'] = Input::get('pid');
            }
            $meta = $disk->getDriver()->getAdapter()->getMetaData($movedFileName);
            $meta['disk'] = config('laradrop.disk');
            $fileData['meta'] = json_encode($meta);
            $file = $this->file->create($fileData);
            
            /*
             * fire 'file uploaded' event
             */
            event(new FileWasUploaded([
                'file'     => $file,
                'postData' => Input::all()
            ]));
            
            return $file;
            
        } 

        catch (Exception $e) {
            
            // delete the file(s)
            if( isset($disk) && $disk) {
                $disk->delete($movedFileName);
                $disk->delete('_thumb_' . $movedFileName);
            }
            
            return $this->handleError($e);
        }
    }

    }

Basically, I am trying to override the store method to add a findimage column in the DB. I have altered the migration made the above controller. I cannot get Auth::user() it always returns null if I make it directly in the laradropController, So I am trying to override it to have that function available to me.

 if (!Auth::user()->currentTeam()){
            $eitherTeamOrUser = \Auth::user()->finduser;
            }

            elseif(Auth::user()->currentTeam()){
                $eitherTeamOrUser = \Auth::user()->currentTeam()->findteam;
            }
            $fileData['findimage'] = 1;

But this does not overwrite the laradropsController.

I have added these routes

//User Media Files 
Route::get('mediaIndex', 'UserMediaController@index');
Route::post('mediaStore', 'UserMediaController@store');
Route::post('mediaDestroy', 'UserMediaController@destroy');
Route::post('mediaMove', 'UserMediaController@move');
Route::post('mediaCreate', 'UserMediaController@create');

And instantiate the laradrops like this

<div class="laradrop"
              laradrop-file-source="/mediaIndex" 
              laradrop-upload-handler="/mediaStore"
              laradrop-file-delete-handler="/mediaDestroy"
              laradrop-file-move-handler="/mediaMove"
              laradrop-file-create-handler="/mediaCreate"
              laradrop-csrf-token="bVgziBueIHaJqYdIruMg5pW2tISSEFMs9Qc5K7AY">
          </div>

Any idea why it doesnt hit my new controller?

making thumbnails rotated?

Some of my thumbnails generated are rotated 90 degrees counterclockwise. What is the factor in determining whether a thumbnail generate will be rotated?

costumize index method

hello
I save my photos in a folder like this
$disk->put( 'cofeeshops/' . $coffeeshop->id . '/main/' . $movedFileName, fopen($tmpStorage . '/' . $movedFileName, 'r+'));
and save the path of photos in the photos table that I created in db like this
`

            $photo                 = new Photo();

            $photo->path           = $disk->url('cofeeshops/' . $coffeeshop->id . '/main/' . $movedFileName);

            $photo->directory      = $disk->url('cofeeshops/' . $coffeeshop->id . '/main');

            $photo->imageable_id   = $coffeeshop->id;

            $photo->imageable_type = 'coffeeshop';

            $photo->save();`

now, how can I develop my own index method?

Is there a way to limit extensions?

Is currently a way to limit the file extensions that the user is able to upload?

Or maybe,

I can validate the extension on onInsertCallback but I don't know how to remove from the list of files to the upload.

If you could give me some hints I would appreciate it. Thanks in advance

artisan vendor:publish do not publish related files

In boot method on LaradropServiceProvider.php there is some file address than a need to publish.
when I use 'artisan vendor:publish' these files do not publish on a related directory.
please help me to fix this problem.

handlers

hello I am trying to implement my own handler

It does not appear to do anything

I have tested the route independently and it works
the route is in my route file not laradrops - is that correct?

laravel won't pull files from files from vendor folder

as the title say laravel won't pull files I'm calling from vendor

for example



<script src="vendor/jasekz/laradrop/js/enyo.dropzone.js"></script>
<script src="vendor/jasekz/laradrop/js/laradrop.js"></script>

It says it cannot find them

EDIT: Found the problem but cannot find solution. artisan vendor:publish does not copy the public file to assets

laradrop does not support utf-8 filename saving

Hi, it is great to use laradrop package in laravel 5 project.
Unfortunately, it seems laradrop does not support utf-8 filenames. I test it with a chinese δΈ­ζ–‡.jpg, the file existing in directory seems mess. The english name is ok.
Please check it.
Thanks!~!

its not publishing the files needed

php artisan publishing is not pulling the files , i tried to clear configs , to clear chache , to autodump , not working at all. please fix this

http://localhost/laradrop/containers NOT FOUND

Hi Jasekz,

Thank for your package. It's interesting me. But I have a problem when install it into my project. When I install and run my url it show alert "Not Found". I followed all steps to install. Thank Jasekz again. Regards,

thumbnails not showing

Hello

The folder preview and thumbs were not showing.

I removed the / before vendor in the line below in laradrop.js and now the folder shows.

folderImage = options.folderImage ? options.folderImage : 'vendor/jasekz/laradrop/img/genericThumbs/folder.png',

In the database public_resource_url if I remove the leading / then the thumbnails show.

I must have a setting wrong somewhere?

Thanks for any help.

Regards
Del

Folder image location.

EDIT: Found the answer in the laradrop.js file:

folderImage = options.folderImage ? options.folderImage : ' /vendor/jasekz/laradrop/img/genericThumbs/folder.png',

Hey :)
I'm integrating this package into a Laravel 5.4 application - I've got everything configured and working well, other than the folder image.
No matter what I have tried, I cannot change the location of this image from the vendor folder which won't load into the browser even though I can see it exists in the vendor folder.

<img src="/vendor/jasekz/laradrop/img/genericThumbs/folder.png" alt="09.08.2017 - 13:33:57">
This always returns not found. I've scoured the source files of the package and cannot find a place to change this path to a publicly accessible one (the app I am extending has a non-standard assets path above the project folder).

Could you point me to the correct place to change this path to reflect my installation config?
I have the file ready in a publicly accessible folder:
http://mydom.com/assets/vendor/jasekz/laradrop/img/genericThumbs/folder.png
So I would just need to prepend 'assets/' to the image src string.
Thanks :)

How to set custom location for each user.

Hi Jasekz.
In my project, I want to give a different location for each user. I know it is easy with dropzone. In Laradrop there is no option for it. Give me a clue to fix this.
Thank you!

laradrop.js

hi
Do you have any documentation about the "laradrop.js"?

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.