Page 1 of 1

Is there any method to save files in local disk directly?

Posted: Thu May 28, 2009 3:41 am
by lakeman2000
On the f-in-box platform,is there any method to save files(png file etc.) in local disk directly except using sharedObject, externalinterface?
Or,is there any method to enable the sharedObject works properly without Error #2130( Unable to flush sharedObject ) occurs?

Posted: Thu May 28, 2009 9:00 am
by Softanics
Thank you for your question.

Yes, it's possible.

The main idea is that you can send commands to your Delphi application from flash, so all the job in saving files can be done by your Delphi code.

Regarding your task. I suggest you the following way.

Use External Interface:
http://www.f-in-box.com/delphi/features ... _app2flash
to pass data from a movie to an application.

You can encode the binary data into a text form (like this "\x45\x56\x89"), then decode it into the application and save the data into a file.

Thank you.

Posted: Thu Jul 16, 2009 7:28 pm
by andreaarg
I've tried this encoding binarydata using base64, but when delphi receives the flashcall event, the line feed/carriage return characters are missing, replaced by blank spaces, and the string is not decodable.
I've solved it using a StringReplace to restore the characters, but when sending a large amount of data, StringReplace is really slow.
I also tried to use "escape" and "HTTPDecode" (URLEncode), but it doesn't work, resulting string after HTTPDecode is not base64 decodable.

Can you recommend any other way to solve this? maybe using a different encoding that doesn't introduce line feeds?

Thanks in advance.

Posted: Fri Jul 17, 2009 1:00 pm
by Softanics
Thank you for your question.

Frankly speaking, I have no ideas how to avoid this problem.

Thank you.

Posted: Tue Oct 06, 2009 1:29 pm
by andreaarg
I've found a solution to my problem with StringReplace: using FastCode Project StringReplace instead of the standard Delphi one.
Just in case someone else has this problem...: http://fastcode.sourceforge.net/

Regarding lakerman2000 problem, Flash 10 introduces FileReference class which let's you save files directly to disk. I've tried it and it woks fine when running the Flash movie within a Delphi application using F-IN-BOX.



Andrea.