Forum GameFS FTP access from SWF

Discussion and help relating to the PlayerIO game asset hosting and CDN solution, GameFS.

FTP access from SWF

Postby FuzzySlash » September 11th, 2012, 10:14 pm

Hello :)

So for the last couple of days I've been working on a cool feature for our MMORPG, to be able to upload custom guild emblems.

I managed to code an uploader using sockets etc. by connecting to GameFS via port 21.
However now testing it on Kongregate, uploading doesn't seem to work :S

I'm guessing it's a security issue. Is there something I can do to get around this?

Edit: The error is:
Error #2044: Unhandled securityError: text=Error #2048: Security Sandbox violation: ... 1347398008 cannot load data from
at Esgrima2_fla::MainTimeline/uploadEmblem()
at MethodInfo-944()
at MethodInfo-822()
at MethodInfo-312()
at MethodInfo-2()

Edit 2: I have just used a flash debug tracer with firefox and it traced the following policy warning:
[strict] Ignoring policy file of xmlsocket:// due to incorrect syntax.

Thank you,
Posts: 37
Joined: April 15th, 2011, 3:59 am

Re: FTP access from SWF

Postby Benjaminsen » September 15th, 2012, 6:32 pm

For obvious security reasons we do not allow you to connect to our FTP service / admin service via Flash.
While storing files in GameFS for your game would be an awesome feature, it´s not something we currently support. A solution, while not optimal would be to store images as bytearrays in a BigDB Object.

You can use the JPEGEncoder form as3corelibs to compact the images
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: FTP access from SWF

Postby FuzzySlash » September 15th, 2012, 6:55 pm

Yes I understand that of course, I guess I could have encrypted my login data but either way it's dangerous.

That's a great solution actually, thank you so much! :)
Posts: 37
Joined: April 15th, 2011, 3:59 am

Re: FTP access from SWF

Postby neurologic » October 17th, 2013, 4:52 am

Storing serialized images in BigDB has a limitation: a maximum size of 500KB. In addition, you can't make use of the CDN file replication and the extra bandwidth on your BigDB can be considerable.

The way I solved this was to set up an upload proxy - I used PHP but you can do this with any server-side language that has built-in FTP functions. In this way, I can specify root folder, optional subfolder to be created, file name and the file as a Base64 encoded string. The PHP script converts the Base64 string back into a file and uploads it to your GameFS FTP account.

This is a single PHP file with no dependencies or special needs. It can be deployed to any PHP server, e.g. AppFog.
Paid Member
Posts: 1
Joined: October 10th, 2013, 11:36 pm

Return to GameFS