file upload file upload
 

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

file upload

Started by smegf0rbrains, May 09, 2006, 04:56:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smegf0rbrains

I'd like to include a simmilar line of code (on my website) to the one in coppermine (upload.php) where you can upload a file from a given URL.

ie. to have a form where a user can type a URL, and then save it to www.mydomain.com/folder

any ideas from any php coders would be loads of help

thanks

Joachim Müller

why don't you take a look at the coppermine code and re-use the proper code on your page?

smegf0rbrains

Yeah I tried that, but I'm only just beginning with php so I couldn't really distinguish between the code i needed and that which didn't apply to me (it's a massive code for one page, I'm starting to really apreciate how much work goes into the gallery).

I've found some more tutorials, so I'll go through them first and see where I can go from there.

http://www.freewebmasterhelp.com/tutorials/php/ - I've found this as a tutorial for php, any other reccomendations for a beginner who has some (but limited) knowlege of programming like VisualBasic?

Joachim Müller

the documentation of php.net is the bible for PHP programmers, both newbies and advanced coders.
Uploading is not trivial, that's why it's hard for a newbie to accompish what you're up to. Keep in mind to check the user input extra careful to avoid malevolent visitors uploading executable code that could ruin your page. Basically, that reason why packages like Coppermine exist is that it's hard even for skilled coders to come up with stuff Coppermine does.
I suggest reviewing the whole idea of URI upload, as it is an invitation to allow your users to steal content from other pages. Your users would need their own webspace as a pre-requisite. I suggest using a traditional upload form (from client to webspace) instead. If a pic already exists on somebody's webspace, I can see little point in re-adding it to yours, as the whole point of the internet is hyperlinking.

smegf0rbrains

Ok thanks for the tips, especially the heads up about the security matters.

I didn't want to be able to upload for others to see the files, but as a quick way of saving to my server a file I downloaded from someone's website. (e.g. if I was to download work from a friend's site, so that I could do something to it on mine - instead of downloading it to my computer then uploading it to my server I could just point this page to the file.)

But no worries, thanks for the help anyway. It seems a bit too advanced for me at the moment. But I have now jumped on the php bandwagon and am busy going through some tutorials and coding away.