Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

questions regarding jQuery::File::Upload

by lightoverhead (Pilgrim)
on Apr 04, 2014 at 14:51 UTC ( #1081155=perlquestion: print w/replies, xml ) Need Help??
lightoverhead has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I am trying to apply it to my project. However I encountered some problems to get it going. I can run jQuery File Upload plugin with using its own php server-side script. it works fine. However, when I tried to write some code using your package, I have some problems. I am sorry if I am asking some naive questions as I may not fully understand how this works. My test script is as below (I just copied the one from cpan) "", in /usr/lib/cgi-bin/

#!/usr/bin/perl -w use strict; use jQuery::File::Upload; #simplest implementation my $j_fu = jQuery::File::Upload->new; $j_fu->upload_dir('/var/www/tempfiles'); $j_fu->handle_request; $j_fu->print_response;

I also changed jQuery File Upload plugin "main.js": from : url: 'server/php/' to url: 'http://localhost/cgi-bin/'

The error message from webpage is "SyntaxError: JSON.parse: unexpected end of data"

The error message from apache error log are:
[Fri Apr 04 02:45:12 2014] [error] [client] Use of uninitial +ized value $url in substitution (s///) at /usr/local/share/perl/5.14. +2/jQuery/File/ line 173., referer: http://localhost/jQuery-F +ile-Upload-9.5.7/index.html [Fri Apr 04 02:45:12 2014] [error] [client] Use of uninitial +ized value in concatenation (.) or string at /usr/local/share/perl/5. +14.2/jQuery/File/ line 158., referer: http://localhost/jQuer +y-File-Upload-9.5.7/index.html [Fri Apr 04 02:45:12 2014] [error] [client] Use of uninitial +ized value in string ne at /usr/local/share/perl/5.14.2/jQuery/File/U line 921., referer: http://localhost/jQuery-File-Upload-9.5. +7/index.html [Fri Apr 04 02:45:12 2014] [error] [client] Use of uninitial +ized value in print at /usr/local/share/perl/5.14.2/jQuery/File/Uploa line 673., referer: http://localhost/jQuery-File-Upload-9.5.7/in +dex.html

I am wondering if any of you have experience with this package and may let me know what errors I really have here.

I actually tried to use this plugin in my perl Dancer project and tried to integrate this package and jquery plugin into Dancer codes I wrote.

Thank you very much.

Replies are listed 'Best First'.
Re: questions regarding jQuery::File::Upload (REQUEST_URI)
by tye (Sage) on Apr 04, 2014 at 15:15 UTC

    For one, jQuery::File::Upload should probably be using $ENV{REQUEST_URI} not $ENV{SCRIPT_URI}. You could try making that change and see if it fixes the problem, especially since that is the kind of thing that will depend on the environment where it is being used and so the module author might not be able to reproduce your problem.

    - tye        

      thank you tye

      but you may notice that I mentioned the server-side php script works well.

      so, it seems not the problems of environment setting.

        You might want to re-read what I wrote more carefully as I wasn't blaming your environment. I was suggesting a small change to make in the code of that module.

        - tye        

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1081155]
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-08-14 21:03 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (155 votes). Check out past polls.