URL/URI Upload Error (any help would be GREAT!) URL/URI Upload Error (any help would be GREAT!)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

URL/URI Upload Error (any help would be GREAT!)

Started by weslemos, February 19, 2007, 02:37:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

weslemos

I've gotten coppermine to work great on my site. 

The only problem is that I cannot get the URL / URI (what is URI btw?)  uploads to work.

Here is a copy of the error message I get:
Information
0 uploads were successful. 
CONTINUE

Error Report
The following uploads encountered errors: 
URI/URL Uploads: 
File Name/URL Error Message
1. http://www.google.com/intl/en_ALL/images/logo.gif HTTP/1.0 200 OK

I think its strange becuase it says the error message is 200 OK.  If I had to guess, I think my server isn't liking this command on line 1386 on upload.php
$fp = fopen($_POST['URI_array'][$counter],"rb");

I have no real reason to think that, but its just a hunch.  Is there a work around for an alternative URL download process?  Has this problem been addressed on these boards before (I looked and looked and could not find it)? 

Thanks so much for your help!

Wes


Nibbler

Uniform resource identifier. Make sure your server has url fopen enabled in phpinfo. There is a an alternative curl based upload.php available I think if you search the boards.

weslemos

Yep.

You hit the problem right on the nose.  Thanks so much for getting back to me quickly.

=========
allow_url_fopen Off Off
=========

Now I'll just need to hunt down the curl based upload.php. 

If anyone has any tips of where to find it I'd be grateful.

Thanks again,
Wes

Nibbler

It's here but it's a 1.3 version. You could try applying the same changes to the 1.4 code if you know php. Otherwise talk to your host, they might enable it for you or provide a way for you to change your own php settings.

weslemos

Ok,

Thanks so much again for your quick responses.  I would have not been able to find that link that you posted.  Before you posted your last post, I went ahead and tried to solve the problem on my own.  I'm not a programmer but I can understand and tweak a decent amount of code.  I was able to even get the images used in the URI areas to copy to my server to a temp folder, but that's as far as I could get it becuase the page would always return an with the same basic error, regardless that the files were being copied to the server.

Once I noticed your post I decided to ditch the work that I had done and try to implement the changes from the 1.3 version to the 1.41 script.  It seemed easy enough.  I compared the files, and just noted and applied the chages that I thought would affect this issue.  Now, upon attempting upload via URL I get an internal server error.  When I looked in my error.log file I get this:

FATAL:  emalloc():  Unable to allocate 76 bytes, referer: http://www.mysite.com/mainfolder/upload.php

The FAQ for this board do talk about something kinda like this, but I don't think that applies, becuase 76 bytes is real small.  So basically I'm stumped.

I attached the modified upload.php script for anyone to look at if they like.

All of the code I added is documented.

Thanks again,
Wes

Nibbler

You missed a change


                    // Initialize the $content variable.

                    $content = '';



                    // The write file has been created and is writeable.  Let's get the content from the URI.

                    while (!feof($fp)) {



                        // Read the data into $content in 8KB chunks.

                        $content .= fread($fp,8192);



                    }


needs to be changed to

$content = curl_exec($fp);

weslemos

 ;D ;D ;D

Grats!  I'm extremely impressed.  I honestly thought it would be a long shot to ask for help but I was proven wrong. 

You know in regards to that line I missed, I actually wrote it down on my little scrap piece of paper here, but I didn't really understand what was going on there so I just left it with a question mark next to it.

Well, just in case someone else has the same problem, I'm attaching the fixed CURL modified upload.php file here.

Oh, and btw did I already let everyone know that Nibbler rocks!!!

Joachim Müller

URI uploads are a silly feature in the first place imo. I suggest not using it at all, as it will only lead to content theft, which you might get held liable for. You (as admin) should use FTP-uploads plus batch-add anyway.