i don't quite understand.

do you mean that i keep the current way to encode in flex, and use the
commons-codec to decode in java?

in flex it's encoded the image byteArray to String.

how to decode that String to byte[] in java?

regarding the javaDoc, it's either decode from Object to Object, or byte[]
to byte[].

Help~~~

c.



Josh McDonald-4 wrote:
> 
> Use commons-codec:
> 
> http://commons.apache.org/codec/
> 
> -J
> 
> On Wed, Mar 12, 2008 at 11:10 AM, coder3 <[EMAIL PROTECTED]> wrote:
> 
>>
>> my question now is more to how to decode the image string:
>>
>> in my mx application, i encode the image to a String:
>>
>> var b64encoder:Base64Encoder = new Base64Encoder();
>> b64encoder.encodeBytes(bytes);
>> imgStr = b64encoder.flush();
>>
>> i send the imgStr to my server, now how to decode the str back to
>> byteArray
>> in java?
>>
>> thanks
>> -c
>>
>>
>> Brendan Meutzner wrote:
>> >
>> > I've got an example I could post using CF... let me know if anyone's
>> > interested.
>> >
>> >
>> > Brendan
>> >
>> >
>> > On Tue, Mar 11, 2008 at 2:18 PM, coder3
>> <[EMAIL PROTECTED]<rrhuang%40hotmail.com>>
>> wrote:
>> >
>> >>
>> >> but i do need to support IE.
>> >>
>> >> is there a sample of creating an image in flex and then call a
>> >> jsp/servlet
>> >> to show the image in a popup window?
>> >>
>> >> i don't want to use FileReference to upload/download. i want to show
>> the
>> >> image to a popup so that user can copy and paste it to the clipboard.
>> >>
>> >> C
>> >>
>> >>
>> >> Frederico Garcia wrote:
>> >> >
>> >> > Paul Andrews escreveu:
>> >> >> ----- Original Message -----
>> >> >>
>> >> >> *From:* Frederico Garcia
>> >> <mailto:[EMAIL PROTECTED] <fmotagarcia%40kemelyon.com>
>> <fmotagarcia%40kemelyon.com>
>> >> >
>> >> >> *To:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
>> >> <flexcoders%40yahoogroups.com><mailto:
>> >> flexcoders@yahoogroups.com
>> <flexcoders%40yahoogroups.com><flexcoders%40yahoogroups.com>>
>> >> >> *Sent:* Saturday, March 08, 2008 3:30 AM
>> >> >> *Subject:* Re: [flexcoders] Flex 3 can save chart as image
>> >> >>
>> >> >> Paul Andrews escreveu:
>> >> >>> ----- Original Message -----
>> >> >>> From: "coder3" <[EMAIL PROTECTED]
>> <rrhuang%40hotmail.com><rrhuang%40hotmail.com>>
>> >> >>> To: <flexcoders@yahoogroups.com
>> <flexcoders%40yahoogroups.com><flexcoders%40yahoogroups.com>>
>> >> >>> Sent: Saturday, March 08, 2008 12:59 AM
>> >> >>> Subject: Re: [flexcoders] Flex 3 can save chart as image
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>> looks like it is not IE friendly.
>> >> >>>>
>> >> >>>
>> >> >>> It's nothing to do with IE - it's the same for all browsers - this
>> >> >>> is all
>> >> >>> about protecting the user from badly behaved flex applications.
>> >> >>>
>> >> >>>
>> >> >>>> Frederico Garcia wrote:
>> >> >>>> <snip>
>> >> >>>>> Hi,
>> >> >>>>>
>> >> >>>>> Actually it's possible =)
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >>
>> http://dougmccune.com/blog/2007/06/03/save-a-snapshot-image-of-a-flex-app-without-a-server/
>> >> >>>>>
>> >> >>>>> And, what you probably heard of similar to "save the chart as
>> >> >>>>> image in
>> >> >>>>> flex3" is the new ImageSnapshot. From the same blog:
>> >> >>>>>
>> >> >>>>>
>> >> >>>>>
>> >>
>> http://dougmccune.com/blog/2007/06/11/imagesnapshot-class-in-flex-3-sdk/
>> >> >>>>>
>> >> >>>>> Hope this helps,
>> >> >>>>>
>> >> >>>>> Frederico Garcia
>> >> >>>>>
>> >> >>>>> <snip>
>> >> >>
>> >> >> Hi Frederico,
>> >> >> I missed your reference to the dougmccune solution (something which
>> I
>> >> >> think I'd seen before, but had really forgotten about)
>> >> >>
>> >> >>>>>
>> >> >> I believe at some point Adobe will change some of Flash Player's
>> >> >> over-protective security policies. File I/O, printing API and
>> >> >> clipboard access are so restricted that developers have to use
>> >> >> workarounds that not only are issue-prone but time consuming, just
>> >> >> to do things that are kind of standard in other plataforms.
>> >> >>
>> >> >> Take the File I/O. What's the bug issue with saving a file? As
>> >> >> long as the user gets the option to accept/reject the file it's
>> >> >> the same as send it over to a server and bouce it back; only it
>> >> >> takes longer.
>> >> >>
>> >> >>
>> >> >> I think I'm mostly with you on this one - the situation we have now
>> is
>> >> >> ridiculous - flash and flex developers routinely getting around the
>> >> >> sandbox using what effectively are workarounds using other
>> technology
>> >> >> to implement file-saving.
>> >> >>
>> >> >> I can understand why the sandbox is there and why Adobe might be
>> >> >> reluctant to give way on the file-saving issue - the last thing we
>> >> >> need is to have the flash player dubbed as some unsafe platform. It
>> >> >> may be that the real problem is not a technical objection but a
>> >> >> political one - to save the player from adverse publicity.
>> >> >>
>> >> >> If the file save feature were to be allowed, it would always have
>> to
>> >> >> be interactive, though perhaps the dialog could be allowed to save
>> >> >> several files in one go and we could also perhaps live with it only
>> >> >> saving certain file types (or issue dire warnings about writing
>> some
>> >> >> others such as .bat or .exe files).
>> >> >>
>> >> >> Inevitably some users will always just say 'yes' to giving
>> permission
>> >> >> to write, simply because they aren't that savvy about OS
>> >> >> technicalities. I wonder if there could be a mini-sandbox that
>> would
>> >> >> protect the user from malicious code trying to write to OS
>> sensitive
>> >> >> areas?
>> >> >>
>> >> >> For 90% of the use-cases for writing files, I think restricting
>> >> >> writing to graphics file types and perhaps xml and non-executable
>> >> >> files would make developers more than happy.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> Until then, we have 2 choices:
>> >> >>
>> >> >> #1 Send the file to the server and download it back.
>> >> >>
>> >> >> #2 Use the "data://" workaround and add a note in your page: *THIS
>> >> >> SITE IS BEST VIEWED WITH FIREFOX 2.0 OR HIGHER* (which is not as a
>> >> >> bad idea as it may sound, considering your target users. According
>> >> >> to my site stats, which is visited mostly by developers, 35.8 %
>> >> >> use Firefox against 19.1 % using IE)
>> >> >>
>> >> >> What are the other 50% using?!
>> >> >>
>> >> > Good question. Have no idea =)
>> >> >
>> >> > Here's my stats (provided by awstats)
>> >> >
>> >> > Unknown 38.2 %
>> >> > Firefox 36.1 %
>> >> > MS Internet Explorer 20.9 %
>> >> > Safari 1.4 %
>> >> > Opera 1.3 %
>> >> > NewsGator (RSS Reader) 0.9 %
>> >> > Mozilla 0.8 %
>> >> >
>> >> > Frederico Garcia
>> >> >> Paul
>> >> >>
>> >> >>
>> >> >> __________ NOD32 2931 (20080307) Information __________
>> >> >>
>> >> >> This message was checked by NOD32 antivirus system.
>> >> >> http://www.eset.com
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Flex-3-can-save-chart-as-image-tp15885511p15986897.html
>> >> Sent from the FlexCoders mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Brendan Meutzner
>> > http://www.meutzner.com/blog/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Flex-3-can-save-chart-as-image-tp15885511p15995968.html
>> Sent from the FlexCoders mailing list archive at Nabble.com.
>>
>>  
>>
> 
> 
> 
> -- 
> "Therefore, send not to know For whom the bell tolls, It tolls for thee."
> 
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Flex-3-can-save-chart-as-image-tp15885511p15996474.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to