Page 1 of 1

Image Generation+uploading of this Image

Posted: Tue Jul 05, 2011 2:35 am
by dhrubajyoti85
Hi,

I want to generate a JPG image and may b with some submit button want to upload the generated Image into a server. I do know how to generate an image in PHP, but how to upload the same directly to server

-Regards
Dhrubajyoti

Re: Image Generation+uploading of this Image

Posted: Tue Jul 05, 2011 5:10 am
by Noodleyman
Why don't you save the image direct to the server upon its creation, rather than posting it in a form back to your server?

I think it would be much better to do that.

Re: Image Generation+uploading of this Image

Posted: Tue Jul 05, 2011 6:34 am
by dhrubajyoti85
I am fine with saving it in Server, but I am generating an Image with Imagecreate(), and I want to save it in server only...
How do I do that...?
Just now I found out something called header('Content-Disposition: Attachment;filename=image.jpg'); --- but this pops-up the image to be saved, but I dont want that, I want it to b saved in server

Re: Image Generation+uploading of this Image

Posted: Tue Jul 05, 2011 6:57 am
by Apollo
dhrubajyoti85 wrote:I am fine with saving it in Server, but I am generating an Image with Imagecreate(), and I want to save it in server only...
Save with imagepng or imagejpeg.

No need to mess with headers or buttons or anything. That's only when you need to send or show something to the visitor. You just want to save the image on the server, and therefore don't need to output anything to the user.

Re: Image Generation+uploading of this Image

Posted: Tue Jul 05, 2011 7:04 am
by dhrubajyoti85
Thanks for the reply Apollo,

Got it...