Jump to content

Recommended Posts

Okay. This must be easier than i'm making it.

Essentially, I have a flash shockwave file, where a user can drag icons around. I want to be able to click a button and save the flash shocwave file to a server. So far, I've managed to convert the flash shockwave to a static jpg image, which I'm happy to do. But how, do I now upload the jpg that I have created to the server. Here is the code I used to create the jpg from the flash file, which all works fine:

 

pixel data (pixel colour/alpha) is first sent from flash to my php file:

 

My (simplified) Php file:

//'img' contains the pixel data sent from flash

$data = explode(",", $_POST['img']);

$height = $_POST['height'];

$width = $_POST['width'];

 

//Allocate image

$image=imagecreatetruecolor( $width ,$height );

//This bit loops through

$data[$i];

$r = hexdec(substr( $data[$i] , 0 , 2 ));

$g = hexdec(substr( $data[$i] , 2 , 2 ));

$b = hexdec(substr( $data[$i] , 4 , 2 ));

 

$color = imagecolorallocate($image, $r, $g, $b);

imagesetpixel ($image,$x,$y,$color);

 

//Output image and clean

header( "Content-type: image/jpeg" );

ImageJPEG( $image );

imagedestroy( $image );

 

This perfectly displays my flash file as a jpg on a new page. Great. Now, how do I upload it to a server?

Any help would be greatly appreciated. Thanks in advance.

Icus.  ???

Link to comment
https://forums.phpfreaks.com/topic/63054-upload-an-image/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.