I'm developing an InDesign CS5 Extension with FB4 and I have to say that as a Switchboard/PatchPanel user I'm really happy to be able to work with InDesign DOM inside Flash applications.
Everything is going just fine except for one "little" problem that's driving me crazy.
Basically my extension read an open InDesign document and upload every image within the document to a server using a WebService.
One of the parameter of this WebService is the image file data encoded in base64.
The question is:
how can I get the image content as string in order to convert it to base64 and send it to server?
I have the image file path but it looks like it's not possible to read local files, I know - it's an old security issue, but it looks also that other extensions (Kuler) are able to write files in system folders.
So far I tried building a function in JS and use a doScript in mxml but it doesn't work and so does the fileReference method.
Is there any workaround fot this?
Ok, I fixed that File problem.
Flash Builder can obviously manage File object:
var myFile:File = new File(path);
What's really weird is that in CS5 (CS4 was different...) if I have an image object "image.itemLink.filePath" return a path like this one: "myUser:Desktop:image.jpg"
The fact is that the File object wants a path like:
Damn CS5, is there a workaround for this instead of rebuilding the path?
Hope this will help.