Code Monkey home page Code Monkey logo

Comments (5)

michelson avatar michelson commented on May 24, 2024

When you upload an image via Dante uploader, you will get a POST request to the server url defined in upload_url option on Dante initialization.
So , your php app should receive that POST request with the image data, not an url. with that data you have to do the upload in php and return to that request the url of your uploaded data, so Date will now that the url returned by your php script is the url to be replaced in the tag on the interface.
I don't do PHP anymore, but in ruby a simple example would be:

  # Handle POST-request (Receive data, save the uploaded file and return url of upload image)
  post "/upload_image" do
    name = params['file'][:filename] 
    path = File.join(File.dirname(__FILE__), '/uploads/images', name)
    File.open(path, "wb") do |f|
      f.write(params['file'][:tempfile].read)
    end
    return "/uploads/images/#{name}"
  end

from dante.

thangngoc89 avatar thangngoc89 commented on May 24, 2024

@michelson don't forget about the recently upload callback :D

from dante.

BaoHan avatar BaoHan commented on May 24, 2024

I found the problem -- forget to restart server ! sad:(
here is simple php code :
//upload.php

from dante.

michelson avatar michelson commented on May 24, 2024

great! , if you found more issues on this , please reopen this issue or submit new one

best!

from dante.

saranghills avatar saranghills commented on May 24, 2024

Wonderful! It was this small piece of information that I missed I guess. Or maybe I was not thinking clearly when you mentioned $_POST in your documentation. I have managed to do both : storing of the image, also the file (will have to improve my code, but successful in the basic features)

Now trying to figure out a way to list the edited pieces and edit them again. :)

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.