Download weird GET request

I have a problem with the actual version of Uploadify (v3.1).

I read the docs, the source and browsed Google and StackOverflow, but cannot find where my problem is.

I have a basic form used to upload files to an internal server. I decided to use Uploadify and manage all of Php with Symfony 2. At first it was not easy, but now everything works fine.

But when I look at my console, I see that uploadify makes a GET request after init and after each of my downloads. The route is called does not exist, and for this page I no longer need action.

Here is my code:

$('#file_upload').uploadify({ debug: true, height: 30, swf: "{{ asset('Route_to_swf') }}", uploader: "{{ path('Route_to_upload') }}", width: 120 }); 

And here is my console error:

 GET http://ip/project/web/app_dev.php/file/upload/ 404 (Not Found) 

The route / file / download does not exist, and I do not see it either in my code or in the source. When I watch the demo on the uploadify website, I see that the code looks exactly the same, but there are no free requests.

Does anyone have a clue?

+6
source share
1 answer

Although it's been more than a year ....

I ran into the same problem and had 10-20 instances per page (so you submit 10-20 background queries).

The problem is that even if the button_image_url parameter is not set, it will still query the current page URL

The solution here is similar to the problem.

Solution: Locate the following code at the top of the jquery.uploadify js file:

 this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url) and rewrite it to: this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = this.settings.button_image_url ? SWFUpload.completeURL(this.settings.button_image_url) : this.settings.button_image_url 
+9
source

Source: https://habr.com/ru/post/916536/


All Articles