Forum Moderators: coopster
// I made up a POSTed form variable where a user puts in a url
// You will want to edit this too, strip_tags(), etc. -- make
// sure it is a valid url before you try to retrieve contents!
// Should return something like ...
// http://example.com/images/image1.jpg
$imageFileName = basename [php.net]($_POST['imageFileName']);
// Gives us:
// image1.jpg
// Now run your edits against this to insure a valid filename
// and make sure you approve of the filename, extension, etc.
// Next you want to retrieve the binary file stream
$imageFile = file_get_contents [php.net]($_POST['imageFileName']);
// run more file edits here such as mime-type
If all is well, you can store the file, etc, etc.