forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: artoonie on February 29, 2008, 05:49:36 am

Title: URL/URL Error
Post by: artoonie on February 29, 2008, 05:49:36 am
I've searched a lot and could not find any solutions to this:

I cannot upload from a URL, and under the normal error message column, there is no text.

I have allow_url_fopen enabled, and I'm using php5.
Local file uploads do work.


The only thing I'm not sure about is upload_tmp_dir and open_basedir, which are mentioned in the documentation, but I don't understand if they need a value. They're currently set to no value.
Title: Re: URL/URL Error
Post by: artoonie on February 29, 2008, 05:54:12 am
Sorry, I knew I forgot something.

Gallery: http://74.86.153.136/%7epriceypi/pics/
Username: test
Password: test
Title: Re: URL/URL Error
Post by: Joachim Müller on February 29, 2008, 07:46:22 am
1) Upgrade. You're using cpg1.4.10, while the most recent stable release currently is cpg1.4.16
2) Use a URL that makes sense: don't use special chars in folder names. %7epriceypi doesn't fall into the category "valid folder name"
3) Make sure you have set the coppermine URL properly in the corresponding config option - the links in your navigation point to http://74.86.153.136/pics/ instead of http://74.86.153.136/%7epriceypi/pics/
Title: Re: URL/URL Error
Post by: artoonie on March 01, 2008, 12:50:57 am
1) I've done all the manual updates up to cpg1.4.14, but I have made a lot of changes around the gallery that would be near impossible to redo/find and place in the new versions. Is it absolutely necessary that I do this?
2&3) I was upgrading my servers at the time, that was the temporary url. I have the same problem at http://www.priceypixel.com/pics
Title: Re: URL/URL Error
Post by: Nibbler on March 01, 2008, 01:02:49 am
upload_tmp_dir is not relevant to URI uploads.

Updating is almost certainly less work than restoring your entire site after getting hacked.

If it's a dedicated server, do you have a firewall in place that blocks outbound connections?
Title: Re: URL/URL Error
Post by: artoonie on March 01, 2008, 02:12:58 am
It's not a dedicated, but I'll certainly ask my host and get back to you.
Title: Re: URL/URL Error
Post by: artoonie on March 02, 2008, 10:18:26 pm
My host looked through everything and could not find what was wrong.
I also did a fresh install to make sure my code was okay, and that didn't work either.

Should i post the logs, would that help at all?
Title: Re: URL/URL Error
Post by: Joachim Müller on March 03, 2008, 07:38:25 am
1) I've done all the manual updates up to cpg1.4.14, but I have made a lot of changes around the gallery that would be near impossible to redo/find and place in the new versions. Is it absolutely necessary that I do this?
2&3) I was upgrading my servers at the time, that was the temporary url. I have the same problem at http://www.priceypixel.com/pics
No, you have not. That gallery is still running cpg1.4.10. Upgrade as I suggested - I'm not willing to look into issues that may be caused by you running an outdated version. Manually applying the hotfixes is not an option - it just takes care of the security-related issues, but it won't iron out bugs that existed in older versions. There is a load of changes that went into cpg1.4.16
Title: Re: URL/URL Error
Post by: artoonie on March 03, 2008, 10:36:38 am
I'll be sure to update to 1.4.16 as soon as I have time, but I'll have to go through each file individually and copy all my changes over, which will take time.

For now, here is the fresh install which does have the latest version of coppermine, but yields the same error:
http://priceypixel.com/temp_delete/index.php
Username: test
Password: pass


Thanks :)
Title: Re: URL/URL Error
Post by: artoonie on March 07, 2008, 12:39:37 am
If it helps, I can tell that the error occurs before the upload process even starts, or really soon after, because it seems to load the error message immediately.
Title: Re: URL/URL Error
Post by: Joachim Müller on March 07, 2008, 05:09:47 am
You haven't done as suggested: when going to http://priceypixel.com/temp_delete/index.php and logging in, the number of upload fields isn't set as suggested in the upload troubleshooting section of the docs.
Title: Re: URL/URL Error
Post by: artoonie on March 08, 2008, 06:48:24 am
Sorry about that =/ I try to follow the rules as closely as possible. I know it gets annoying for you to have to repeat "RTFM" over and over.


Anyhow, fixed.
Title: Re: URL/URL Error
Post by: artoonie on March 08, 2008, 07:40:54 am
Sorry, I just realized:
The file uploads work, it's the URL/URI that doesn't. I'll keep it at the requested settings anyhow, until you request a change.
Title: Re: URL/URL Error
Post by: Joachim Müller on March 08, 2008, 11:34:10 am
Make sure that your webserver fulfills the pre-requisites for allowing URI uploads - check phpinfo. I wouldn't mind though: URI upload is a silly feature anyway. You as admin should use FTP-upload plus batch-add anyway.
Title: Re: URL/URL Error
Post by: artoonie on March 08, 2008, 09:21:37 pm
I need URL uploads mostly for another script i've written, which won't be nearly as user-friendly without it.

I've checked the upload prerequisites, but I may be missing something. Here's any possible errors:



Thanks again.
Title: Re: URL/URL Error
Post by: artoonie on March 11, 2008, 04:11:05 am
    [lli]There's a setting I've only recently seen in phpinfo, "allow_url_include," which i believe (according to google) was introduced in php 5.2. I'm thinking that this should be set to on. I'm going to contact my host and let you know.[/li][/list]
    I finally got this set to On, but it did nothing.
    Title: Re: URL/URL Error
    Post by: Joachim Müller on March 11, 2008, 07:18:58 am
    URI upload is a silly feature in the first place. We consider removing it from future versions anyway. I wouldn't bother if I were you. You (as admin) should use FTP-upload plus batch-add anyway.
    Title: Re: URL/URL Error
    Post by: artoonie on March 11, 2008, 09:02:34 pm
    I've written a script that requires URL uploads to work, but I guess I'll try rewriting it for File uploads.
    Title: Re: URL/URL Error
    Post by: artoonie on March 15, 2008, 06:18:31 pm
    Okay, I decided to enter outputs throughout the program to see what's happening first.

    Line ~1773:
    Code: [Select]
                                    // Undocumented error. Note an error. Return status code.
                                    $URI_failure_array[] = array( 'failure_ordinal'=>$failure_ordinal, 'URI_name'=> $_POST['URI_array'][$counter], 'error_code'=>$header['wrapper_data'][0]);
    That's where the error is. Apparently, $header['wrapper_data'][0] is blank.

    However, there is no real error, because when I remove the continue; statement on line ~1779, it works.

    Thus, since this is an else rather than an else if, the problem lies here:
    Code: [Select]
    if(!(strstr($header['wrapper_data'][0], '200'))) {on line ~1736

    The server does not return a status code 200, but there is no error.




    Removing the continue is probably not the best way to go about solving this in case another uncoded error is encountered.


    Seeing as $header['wrapper_data'][0] is blank, and we're looking for a substr of 200 in the front, I'm going to do the following. Let me know if other users should/shouldn't use this mini "mod":
    Open upload.php

    Find
    Code: [Select]
    if(!(strstr($header['wrapper_data'][0], '200'))) {
    Replace with
    Code: [Select]
    if(!(strstr($header['wrapper_data'][0], '200')) && $header['wrapper_data'][0]!="") {



    I hope this helps.