cancel
Showing results for 
Search instead for 
Did you mean: 

type=file dashlet ??? JSON

yascorp
Champ in-the-making
Champ in-the-making
Hi,
I have a dashlet with an input type=file.
I have done a request to send inputs data values to alfresco, I could get all my inputs values in my xxx.post.json.js, but not the content of my sended image file.
I found many difficulties to do it with formdata (multipart), I can't .
Is it possible to do it in the JSON way ??? and how can I get : my image content ???

newFile.content = content;

I can't use :
newFile.properties.content.write(content); //the problem come form write.

please help me
Thnx & regards
2 REPLIES 2

romschn
Star Collaborator
Star Collaborator
Have you checked the existing file upload functionality in alfresco share? You can invoke your webscript the same way. Take a look at flash-upload.js/file-upload.js/dnd-upload.js, it makes a call to api/upload webscript to upload a content.

Hope this helps.

yascorp
Champ in-the-making
Champ in-the-making
Thnx for your reply !
Yes I check those files but I can't find a solution so I decide to make it my way with input type file, but when I recieve my image, I can't view it because It's corrupted.
The content of my image is encoded in base64 (does Alfresco read the base64 file content or not ???)
Tnnx for you answer.
Regards