CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
How to pass filepath as a parameter to URL using perl (SOLVED

 



ash1351
New User

Sep 3, 2015, 2:55 PM

Post #1 of 1 (1260 views)
How to pass filepath as a parameter to URL using perl (SOLVED Can't Post

Below query was solved at stackoverflow. http://stackoverflow.com/questions/32385729/how-to-pass-filepath-as-a-parameter-to-url-using-perl

I am testing my perl code. I want to pass filepath as a paramter to the URL of the page.

The perl code is dependent on this filepath entirely.

When i set the filepath inside my perl code. (hard coded path), i am able to execute the perl code without any errors. Here is the variable

Code
    my $filename="\\\\sfoaepmdata.dcc.com\\folder\\data.txt";


If i pass it via URL, it doesnt work as expected. Can anyone suggest how to pass filepath as a variable in the URL ?


Here is what all i tried to someohow transfer $filename from url to perl code.

Code
    http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=\\\\sfoaepmdata.dcc.com\\folder\\data.txt 
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=\\sfoaepmdata.dcc.com\folder\data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=//sfoaepmdata.dcc.com/folder/data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=////sfoaepmdata.dcc.com//folder//data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=file://sfoaepmdata.dcc.com/folder/data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=file:////sfoaepmdata.dcc.com//folder//data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=http:////sfoaepmdata.dcc.com//folder//data.txt
http://apmqa.dcc.com/cgi-bin/test/editor.pl?filename=http://sfoaepmdata.dcc.com/folder/data.txt



The above data may seem confusing. But please only read values after ?ffilename. Can anyone pls suggest.



I also tried passing other normal paramters and it worked. for e.g.
$account=GEL; this works but only the filepath doesnt work.

Code
    http://apmqa.dcc.com/cgi-bin/test/editor.pl?account=GEL



(This post was edited by ash1351 on Sep 3, 2015, 4:54 PM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives