0

I have an app which uploads videos, using a 3rd party host (bitsontherun). Everything works fine, except it doesn't have an upload progress bar, so I'm trying to use fineuploader to show one. However I keep getting 2 errors in the developer window in Chrome, and the file no longer uploads:

POST http://testevent.xavy.dev/video.json?qqfile=Kitten+Wearing+a+Tiny+Hat+-+Audition+Outtakes+(tuvideo.matiasmx.com).mp4 404 (Not Found) fineuploader.jquery.js:2383
qq.extend._upload fineuploader.jquery.js:2383
qq.UploadHandlerAbstract.upload fineuploader.jquery.js:1986
qq.FineUploaderBasic._uploadFile fineuploader.jquery.js:946
qq.FineUploaderBasic._uploadFileList fineuploader.jquery.js:926
qq.FineUploaderBasic.addFiles fineuploader.jquery.js:737
qq.FineUploaderBasic._onInputChange fineuploader.jquery.js:855
qq.UploadButton.onChange fineuploader.jquery.js:748
(anonymous function) fineuploader.jquery.js:557
[FineUploader] Error when attempting to parse xhr response text (SyntaxError: Unexpected token <) fineuploader.jquery.js:157
qq.log fineuploader.jquery.js:157
qq.FineUploaderBasic.log fineuploader.jquery.js:667
qq.extend._onComplete fineuploader.jquery.js:2406
xhr.onreadystatechange fineuploader.jquery.js:2345

I've followed their set-up instructions:

  $(".videos-fine-uploader").fineUploader
    request:
      endpoint: "/video.json"

    debug: truedebug: true

The error, I'm think, is with the endpoint, which points the jQuery to a route. However, whatever route I point it to, it doesn't work. What I need to do is put the following (successful) params, but I have no idea how even after reading over a dozen different SO answers and tutorials from around the web.

Started POST "/videos" for 127.0.0.1 at 2012-12-22 18:26:07 +0000
Processing by VideosController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"lg/*******=", "video"=>{"title"=>"test", "industry_list"=>"", "speaker_list"=>"", "theme_list"=>"", "description"=>"test", "user_id"=>"", "video_url"=>#<ActionDispatch::Http::UploadedFile:0x007fe2018a2d58 @original_filename="Kitten Wearing a Tiny Hat - Audition Outtakes (tuvideo.matiasmx.com).mp4", @content_type="video/mp4", @headers="Content-Disposition: form-data; name=\"video[video_url]\"; filename=\"Kitten Wearing a Tiny Hat - Audition Outtakes (tuvideo.matiasmx.com).mp4\"\r\nContent-Type: video/mp4\r\n", @tempfile=#<File:/var/folders/jl/nqsrgwy973j73gnj4j1hd2hc0000gn/T/RackMultipart20121222-14651-1824c66>>}, "commit"=>"Create Video"}

Could anyone advise me on best next steps to get this working?

Thx

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
jfdimark
  • 2,239
  • 1
  • 14
  • 27

2 Answers2

0

This has nothing to do with progress bars. I'm not sure why your question title mentions this. As you suspected, you are simply specifying the wrong endpoint. No one can help you fix this. You simply need to figure out the correct address of the server that will be handling the requests and enter that as your endpoint.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
  • Thanks Ray. This is the jQuery you look after, right? Do you know of any examples of it implemented for rails? – jfdimark Dec 23 '12 at 13:06
  • Yes, I'm the maintainer. Note that Fine Uploader is not a jQuery library. I simply created an optional wrapper for those who wish to seamlessly integrate Fine Uploader into their otherwise jQuery project. I don't have any direct experience with rails, but there is a [wiki page dedicated to rails](https://github.com/Widen/fine-uploader-server/wiki/Rails---CarrierWave) in the Fine Uploader wiki Github project that may be of some use to you. I can't verify its accuracy. If you run into problems, posting in the support forums with a rails-specific question may bear some fruit. – Ray Nicholus Jul 09 '13 at 20:10
0

I think you just need to write:

$(".videos-fine-uploader").fineUploader
  request:
    endpoint: "/videos"
nathanvda
  • 49,707
  • 13
  • 117
  • 139
  • Thanks Nathanvda - that didn't work. The complication was in how the Videos controller was set up to work with bitsontherun, and fineuploader requires for the request endpoint to be set when it's created but because the upload was happening after the first ajax call that's not possible. Changing it is tough because it doesn't expect that it would change. I had 3 professional programmers attempt it and the 3rd finally got a progress bar working but not with fineuploader. – jfdimark Jan 10 '13 at 05:19
  • Ok, I don't quite understand that. How could an endpoint not be available when it is created? But maybe you mean the url is not fixed. Whatever. I am interested to learn which solution you did use then? – nathanvda Jan 10 '13 at 09:35