How do I go about limiting the size and type of attachments for a specific service? I am working with the Editor widget with simple toolbar sample. I know this should be straight forward, but I cannot find anything on the the subject.
Thanks!
I dont understand ur question , but i worked with attachments before.
U must specified:
I remember in flex i worked with bytearrays to add the files at the server.
Let me clarify:
how do i modify the edit sample
to only allow a user to upload 1 photo less than 1 mb in size?
when u capture the pic that u want to upload in ur app u have the following 2 steps:
1st: see the file size. How it has to be less than 1mb before u upload it to the service, u need to see the var myvar.size of the file < than 10000 (in kb).
2nd: if the size is ok, then u have to check if the feature that u wanna add the attachment it has attch already, so u can do that with queryAttachmentInfos. So if the result returns an array with 1 or more results for that feature, u need to delete them or not let the user upload the pic. In the case if u wanna overwrite ur pic, u need to delete all the attachments related to that feature and then upload ur pic.
I hope this help.