Uploading to BW site with PHP

G

Gegzy

Guest
Hi.

Here's the info: Using my BW site, I want to be able to allow users to upload screenshots to a given directory (say "images/shots"). I also want to be able to use the imaging functions to automatically create a thumbnail for the site as well.

However, the uploading side works...but the this line fails for some reason:

{
global $shotsfile;
global $shotsfile_name;
.
.
if( !copy( $shotfiles, "images/shots/$shotsfile_name" )
echo "Error during copy";
.
.
}

The copy fails all the time - yet when I run the same web site on my own PHP server here at home, it all works a treat.

Any ideas on what I need to do?

Thanks

-- Gegzy
 
J

Jonty

Guest
Hi Gegzy

Just a flying visit, so forgive the lack of a detailed reply. Have you tried switching on PHP's safe mode at home? BW runs PHP with that setting enabled for safety reasons and thus it may be that which is causing the problems with the code above. Thankfully, there is usually a very simple workaround available for all such problems, so hopefully there will be no difficulties in fixing the code.

Just on a side note, this script, athough very cool, does sound like it could really eat up your bandwidth quota depending on it's popularity. Have you got any idea from running the script at home what kind of bandwidth is utilised?, since we don't want you to get error messages if it proves popular :)

Kind Regards

Jonty

P.S. I'll look into the specifics tomorrow and hopefully get back to you with something a little more constructive
 
G

Gegzy

Guest
Hehehe!

Right, I've managed to kill two birds with one stone actually.

Rather than use up my BW web space and it's bandwidth, I now upload files using my server at home. The process of uploading screenshots now takes the form of opening a little explorer window that connects to my server, and performs the downloads from there.

It's a little convoluted, but it works well actually.

Oh and Jonty, just for information, I have put my PHP installation into "safe mode" and it's working just as it was before. So I'm not sure what was happening with the errors.

Thanks anyway for your help, and I'm pleased to have a working solution now.
 

Users who are viewing this thread

Top Bottom