Question: This link may not be followed from within Galaxy
0
gravatar for luyizhen
4.5 years ago by
luyizhen10
United States
luyizhen10 wrote:

I upload the file and I can see the detail(like this url: https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09/show_params) in usegalaxy.org website

 

but when I use curl to download it, I got error: "This link may not be followed from within Galaxy"

my php code are:

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09/show_param");
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_COOKIE, 'galaxysession=bbd44e69cb8906b543889f6ebcb0f23d40822fa0fadc2a10d088a7a073a95f454dba36841fb66580');
        curl_setopt($ch, CURLOPT_REFERER, 'https://usegalaxy.org/');
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0');
       
        $response = curl_exec($ch);
        curl_close($ch);

        print_r($response);

 

and the cookie, I will use the latest value

who can tell me the error, and how to fix it?

thanks

upload galaxy dataset • 1.1k views
ADD COMMENTlink modified 4.5 years ago • written 4.5 years ago by luyizhen10

yes, because the url: https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09

can visit without login

ADD REPLYlink written 4.5 years ago by luyizhen10

and url https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09/show_param need login can see

ADD REPLYlink written 4.5 years ago by luyizhen10

Please explain your problem, I can't see it.

ADD REPLYlink written 4.5 years ago by Martin Čech ♦♦ 4.9k

first step: I login by email and password using php curl code, and I got the session cookie(i.e: galaxysession=bbd44e69cb8906b543889f6ebcb0f23d40822fa0fadc2a10d088a7a073a95f454dba36841fb66580)

my issue is how to keep login status to next step(i.e show detail: https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09/show_param)

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, ' https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09/show_param');
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_COOKIE, 'galaxysession=bbd44e69cb8906b543889f6ebcb0f23d40822fa0fadc2a10d088a7a073a95f454dba36841fb66580');
        curl_setopt($ch, CURLOPT_REFERER, 'https://usegalaxy.org/');
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
        
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $response = curl_exec($ch);
        
        curl_close($ch);
        var_dump($response);

 

I got: string(49) "This link may not be followed from within Galaxy."

Can you help me?

ADD REPLYlink written 4.5 years ago by luyizhen10

Thanks, I will try to have a look at the api of galaxy.

ADD REPLYlink written 4.5 years ago by luyizhen10

If the API is what you were looking for, please mark my post about it above as an accepted answer -- this helps us know when a problem is resolved and makes it easier for others with similar issues to find correct answers in the future.

ADD REPLYlink written 4.5 years ago by Dannon Baker3.7k
0
gravatar for Martin Čech
4.5 years ago by
Martin Čech ♦♦ 4.9k
United States
Martin Čech ♦♦ 4.9k wrote:

try it without the last part of url https://usegalaxy.org/datasets/bbd44e69cb8906b5bfdda35045c40d09, the dataset looks like picture with red flowers

ADD COMMENTlink modified 4.5 years ago • written 4.5 years ago by Martin Čech ♦♦ 4.9k
0
gravatar for Dannon Baker
4.5 years ago by
Dannon Baker3.7k
United States
Dannon Baker3.7k wrote:

I'm not exactly sure what your end goal is here, but if you're scripting against Galaxy you should probably be using the API:

http://galaxy-dist.readthedocs.org/en/latest/lib/galaxy.webapps.galaxy.api.html

Did you attempt to use the API and found it unsuitable for the task at hand?  If so, can you provide more details about what your project is trying to accomplish?

ADD COMMENTlink written 4.5 years ago by Dannon Baker3.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 171 users visited in the last hour