4 Replies - 2851 Views - Last Post: 25 October 2016 - 07:12 AM Rate Topic: -----

#1 J33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-October 16

Dropzone.js and modelglue

Posted 21 October 2016 - 12:12 PM

I'm trying to integrate dropzone.js application into a coldfusion website but I'm having trouble getting the event using modelglue to upload images

 
        <script type="text/javascript">
            var myDropzone = new Dropzone("div#myId", {
                url: "index.cfm?event=ajax.imageUpload&id=<cfoutput>#session.cfid#</cfoutput>",
                
                init: function(){
                    this.on("maxfilesexceeded", function(file){
                        this.removeFile(file);
                        alert("no more images please!");
                    });
                }
            });
        </script>



Is This A Good Question/Topic? 0
  • +

Replies To: Dropzone.js and modelglue

#2 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6383
  • View blog
  • Posts: 25,781
  • Joined: 12-December 12

Re: Dropzone.js and modelglue

Posted 22 October 2016 - 12:39 AM

What trouble are you having?
What happens or doesn't happen? Under what circumstances? Etc.
Was This Post Helpful? 0
  • +
  • -

#3 J33  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-October 16

Re: Dropzone.js and modelglue

Posted 22 October 2016 - 04:06 AM

I'm trying to call the event so it can upload the image, but it doesn't work. Most of the time it says specified url cannot be found. From what I know, it should work. But I'm not sure if I'm calling the event correctly.

This post has been edited by andrewsw: 22 October 2016 - 04:20 AM
Reason for edit:: Removed previous quote, just press REPLY

Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • the case is sol-ved
  • member icon

Reputation: 6383
  • View blog
  • Posts: 25,781
  • Joined: 12-December 12

Re: Dropzone.js and modelglue

Posted 22 October 2016 - 04:20 AM

I have no idea about ColdFusion myself but shouldn't your index page be preceded by something like "/" to identify the root location? And are you able to test it with fixed/test values rather than those CF variables?

Also print out the url value so that you can check it and enter it into the addressbar.

[As I say, I know nothing of CF, so the above are general comments, probably not using the right CF terminology.]
Was This Post Helpful? 0
  • +
  • -

#5 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Dropzone.js and modelglue

Posted 25 October 2016 - 07:12 AM

View PostJ33, on 22 October 2016 - 07:06 AM, said:

I'm trying to call the event so it can upload the image, but it doesn't work. Most of the time it says specified url cannot be found. From what I know, it should work. But I'm not sure if I'm calling the event correctly.


Welcome to DIC, J33. I had delayed responding to your post because our policy here is to help devs figure out their issues rather than solve them for them. To that end, we like to see what you've done to address your issue...or at least describe it in some level of detail more than "I'm having trouble". However, you've expanded on your original post with "[m]ost of the time it says specified url cannot be found" and that is something we can start to guide you on.

So, looking at your code snippet, you have an index.cfm page that should accept a URL param called "event" into which you believe you should be able to pass the value of "ajax.imageUpload" and pass a second param called "id" which you wish to pass the user's CFID from the session scope...and from that you say that sometimes it says that the URL cannot be found.

So, what we're dealing with here is how to troubleshoot and debug an issue. The good news is that the error message (URL not found) is fairly easy to confirm. Have you tried opening a second browser tab and going to the URL directly with the same params you're trying to use here? If not, try that first. Right off the bat, it'll likely say that the URL can't be found...or if it can find it, it may not know what to do with the URL params you're trying to pass in.

But this is literally step 1. Try that and see where that gets you. Using Modelglue may indeed be a hindering factor here but since every call to your CF application should be routing through that framework, have you looked around for how to work with Ajax/jQuery with Modelglue? There should be copious examples on the web and on Modelglue specific user forums for how to employ Ajax with that framework.

Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1