Some background notes:
So i'm building an OO based media management system for my website and i'm having trouble with the following...
example url: /media/image/3252/
My mediaHandler can recognize what type of file needs, via the URL, to be downloaded or send, such as an image object for example, or a .zip file. The ID is sent read from the URL as well so it knows where to look in the DB.
The mediaHandler then grabs the file and returns and appropriate fileObject. It also checks the referrer (to eliminate leechers) and updates the download count / hit count in the db.
In the example URL i'm trying to get an image, so an imageObject would be returned.
The image Object has a filepath, filename, width and height, among other things.
My mediaHandler also can take a width or a height as an argument and, using the gd library, create a resize & logo branded output image.
An image object (which is a child of a file object), has the contents of the file as one of its properties**.
If an image is not to be resized, the handler is supposed to just pass the image (i think via headers) to the browser. // This is where i need help, i can't figure this out....
If theres a manipulation to be made, the image needs to be manipulated, cached and stored cache in the db, and then sent to the output to the browser.
**don't know if this is useful but i thought it might be.
The question...
I would like to know if there is a way to "pass the file" through my media handler without using GD to create a blank image and using up more memory it should be.
I know theres a way with headers or something but I'm struggling to find an answer...