0
PHP problem: Jpeg from Flash to Server
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/td-p/392038
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
I've been on this bit of code for a couple of days and have
traversed many snippets of code.
I created a drag and drop app which allows you to download the image you've created, and that works pretty well. I got the code thanks to henry jones, used the jpegencoder, forum member David Stiller helped me with that.
Anyway, what's driving me nuts may be a small thing. I found someone else who had the identical
problem, using the exact php code I was using. You can see the code there or at the bottom of this post. Deleting the second header makes the image appear directly in another window. It's a treat.
He says all he had to do to get it to work was:
problem solved
file_put_contents('filename.ext', $GLOBALS["HTTP_RAW_POST_DATA"]);
what is filename.ext? why doesn't this work for me? I thought it was just an example and switched it for thumb.jpg, a same level existing jpeg, and set permissions at 666. I get no error but no image. Tried about a hundred other things. Emailed the poster but got no answer.
anyone know what would solve this problem?
I created a drag and drop app which allows you to download the image you've created, and that works pretty well. I got the code thanks to henry jones, used the jpegencoder, forum member David Stiller helped me with that.
Anyway, what's driving me nuts may be a small thing. I found someone else who had the identical
problem, using the exact php code I was using. You can see the code there or at the bottom of this post. Deleting the second header makes the image appear directly in another window. It's a treat.
He says all he had to do to get it to work was:
problem solved
file_put_contents('filename.ext', $GLOBALS["HTTP_RAW_POST_DATA"]);
what is filename.ext? why doesn't this work for me? I thought it was just an example and switched it for thumb.jpg, a same level existing jpeg, and set permissions at 666. I get no error but no image. Tried about a hundred other things. Emailed the poster but got no answer.
anyone know what would solve this problem?
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392039#M11133
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
are you using GET or POST to send data to your php
file?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392040#M11134
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
POST, kglad, thanks for looking it over.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392041#M11135
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
fix your 2nd header then. you're using GET there.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392042#M11136
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
I actually have the second header //commented out, that's why
you don't see a download window. I didn't make that clear,
sorry.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392043#M11137
Apr 19, 2008
Apr 19, 2008
Copy link to clipboard
Copied
why's it commented out? aren't you trying to save a bitmap
from flash to a local file?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392044#M11138
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
No, look at the title, I'm trying to save it to the server,
ultimately to use as part of a postcard app.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392045#M11139
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
then you need code to write the file. use:
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
$fp = fopen($_GET['name'], 'wb');
fwrite($fp, $im);
fclose($fp);
} else echo 'result=An error occured.';
?>
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
$im = $GLOBALS["HTTP_RAW_POST_DATA"];
$fp = fopen($_GET['name'], 'wb');
fwrite($fp, $im);
fclose($fp);
} else echo 'result=An error occured.';
?>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392046#M11140
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
Thanks KGLAD! That works exactly as needed. Do you think you
can spot in the code below what I could take out, so it wouldn't
also open a blank page? I thought commenting out navigatetoURL
would do it, but no.
However I am THRILLED that it writes to the server.
However I am THRILLED that it writes to the server.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392047#M11141
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
actually I like opening the window, I reset the code so the
new image goes there as well as to the server, and it will work
well, especially once I figure how to add text to it. Php is
certainly exciting in its possibilities. If anyone knows of a good
current book that deals with all its image manipulation abilities,
I'd love to know.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392048#M11142
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
that shouldn't open a new page. clear your cache and retest.
(though, you'll need to uncomment your load() method or you won't
be saving anything to your server.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
funonmars
AUTHOR
Explorer
,
LATEST
/t5/animate-discussions/php-problem-jpeg-from-flash-to-server/m-p/392049#M11143
Apr 20, 2008
Apr 20, 2008
Copy link to clipboard
Copied
hmm, even with the cache cleared, (nd of course the load
method not commented(!)) it opens another page, the php page.
However, I've got it now so it goes directly into my postcard
folder and can be sent, which is what got me started on this path.
If I solve how to write into the window opened a link to the
postcard app, (and that's about my php level) I'll be set. It does
seem as if commenting out the _blank line should have stopped the
new window. The url it opens is the full jpgURLRequest
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

