I’m trying to programmatically add a tint to an image. I’ve done this very easily with a form and the $_FILES array but I need to get the image from a URL, and the images I’m trying to use are on my own server if that is important. Here’s a sample code of the working form function
$img = new Upload($_FILES['imgfile']);
Now all I need is something like $img = new Upload(fopen($image_path); But this isn’t working… Please help me!!
In the following code, you are passing a $_FILES array structure to your Upload class:
The variable
$_FILES['imgfile']itself is an array, consisting of named members such as'name','tmp_name'and others – information about the file that has been passed to PHP by the server receiving the uploaded file.Your
Uploadclass appears to be designed to handle this sort of structure. It will probably have been designed specifically for handling file uploads, so you may need to modify it a bit to allow it to be passed any file path as a parameter instead of this array structure.