Code Monkey home page Code Monkey logo

Comments (11)

michelson avatar michelson commented on May 24, 2024

Hi @akkias , dont't worry.

after upload the image where is keept ? is it visible from some path ?
let' say localhost:8888/images/name.jpg ? if it's so the upload response, where the file is uploaded, should return that path.

best

from dante.

akkias avatar akkias commented on May 24, 2024

Yes, I can view that file by hitting some url like localhost:8888/uploads/images/name.jpg
but I am not able to call that image in saved data because I am saving editor data by doing editor.getContent() which returns BASEURI.

from dante.

akkias avatar akkias commented on May 24, 2024

So what we are doing is we collecting data from response.all and I think I am probably wrong there.

from dante.

michelson avatar michelson commented on May 24, 2024

the upload process is different from editor.getContent and save interval, when you upload an image through Dante uploader , Dante expect that the server response of that upload returns the image path, that's it, like localhost:8888/uploads/images/name.jpg, if it's so Dante will handle the image display properly

from dante.

michelson avatar michelson commented on May 24, 2024

check the image server example bundle exec rackup config.ru

from dante.

akkias avatar akkias commented on May 24, 2024

I am using PHP (Laravel) and kinda stuck on that thing only :(

from dante.

akkias avatar akkias commented on May 24, 2024

If you don't mind, can you elaborate how to handle and retrive editor data.

from dante.

michelson avatar michelson commented on May 24, 2024

I personally don't use auto save, so how I do is listen to the form submit event , and then i call editor.getContent() and I pass that value to my form text input before submit.
something like:

    btn = form.find(".btn.submit")
    btn.on('click', function( event ) {
        $('form').find("#post_content_input").val(editor.getContent());
        $('form').submit()
    })

from dante.

thangngoc89 avatar thangngoc89 commented on May 24, 2024

@akkias I'm using Laravel 5.0 to handle Dante upload and here is my code :

public function store(uploadFileRequest $request)
    {
        $file = $request->file('file');

            $destination = storage_path().'/uploads/';
            $file->move($destination, 'random_file_name_here');

         echo 'http://example.com/image.jpg';
    }

For paste image, I suggest you to use Intervention package, (http://intervention.olivervogel.net/)
You can do some thing magic like this:

public function paste(Request $request)
    {
        // array('image' => base64 string)

        $img = Image::make($request->image)->save('path_to_file');
    }

from dante.

akkias avatar akkias commented on May 24, 2024

Yay! It worked! thanks much Michelson

from dante.

akoury avatar akoury commented on May 24, 2024

hey @thangngoc89 can you tell me how are you using Dante in laravel? i cant get it to work. Thanks!

from dante.

Related Issues (20)

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.