Everything seems to be fine with the code you have written. you can also check the "layer details" property of
the feature layer to check whether attachments have been enabled on your featurelayer.
var layerDetails:LayerDetails = myfeaturelayer.layerDetails
if(layerDetails.hasAttachments)
{
Alert.show("attachments enabled");
savePDF(byteArr);
}
else
{
Alert.show("Please enable attachments");
}
One more thing is, you could try passing the "content type" as a parameter instead of passing null..
myfeaturelayer.addAttachment(1,byteArr,"ElementoPDF", "pdf",new AsyncResponder(resultado,malresultado));
And like i said earlier you need to pass a valid object_id.
And here's a small tip for to get your debugger working.
Assuming that you are working with flash builder it is necessary that the debugger version installed is the same as the version of flash player in your browser.
- First check the version of flash player running your browser. Navigate to the following link to check the version Flash Player Help
if it is an outdated version I recommend you update it.
2. Once you've got your flash player version updated/installed navigate to the following link to download the debugger
Adobe Flash Player - Downloads
Select the appropriate debugger and click install.
3. Then insert some breakpoints,run your app in debug mode and i think your off..
Actually its really hard to suggest any solution cause your code seems fine... i guess through a debug session you might be able to track some errors..or maybe some section of code that isnt getting called.. hence the expected output is void.
Hope this helps.. do get back,...
Regards,
Nigel.