Image Generation+uploading of this Image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dhrubajyoti85
Forum Newbie
Posts: 3
Joined: Tue Jul 05, 2011 2:33 am

Image Generation+uploading of this Image

Post 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
Noodleyman
Forum Newbie
Posts: 23
Joined: Thu Jun 23, 2011 4:49 pm

Re: Image Generation+uploading of this Image

Post 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.
dhrubajyoti85
Forum Newbie
Posts: 3
Joined: Tue Jul 05, 2011 2:33 am

Re: Image Generation+uploading of this Image

Post 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
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

Re: Image Generation+uploading of this Image

Post 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.
dhrubajyoti85
Forum Newbie
Posts: 3
Joined: Tue Jul 05, 2011 2:33 am

Re: Image Generation+uploading of this Image

Post by dhrubajyoti85 »

Thanks for the reply Apollo,

Got it...
Post Reply