Select to view content in your preferred language

Is it possible in 10.1 to restrict the attachment to certain types, e.g. jpg only

2498
3
Jump to solution
01-07-2013 02:50 PM
JackZHANG
Frequent Contributor
Is it possible in 10.1 to restrict the attachment to certain types, e.g. jpg only.
Also would be nice to restrict the file size in case someone uploading a huge file blow up the server. Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AlexeyTereshenkov
Deactivated User
I think this should be possible to achieve while using of the APIs with some custom programming where you filter what type of files will be visible in the Browse window. I expect you'd need to write own filter with the methods that are not in the scope of Esri Web APIs. You might like checking with one of the API Reference pages for that though.

Regarding the max size - this is defined on the server level: http://resources.arcgis.com/en/help/rest/apiref/uploads.html#uploadlimitdesc

View solution in original post

0 Kudos
3 Replies
AlexeyTereshenkov
Deactivated User
I think this should be possible to achieve while using of the APIs with some custom programming where you filter what type of files will be visible in the Browse window. I expect you'd need to write own filter with the methods that are not in the scope of Esri Web APIs. You might like checking with one of the API Reference pages for that though.

Regarding the max size - this is defined on the server level: http://resources.arcgis.com/en/help/rest/apiref/uploads.html#uploadlimitdesc
0 Kudos
JackZHANG
Frequent Contributor
Thanks a lot tereshenkov. At the bottom of the the API link you mentioned shows me I can specify the upload type and maxim file size by using the advanced admin page, which is exactly what I need. And no coding required.

You can modify the AllowedUploadFileTypes and MaxUploadFileSize properties for a service or service extension using the ArcGIS Server Administrator Directory:

1. Login to ArcGIS Server Administrator Directory.
http://<host>:<port>/<instance>/admin
2. Browse to the service.
http://<host>:<port>/<instance>/admin/services/<servicename>.<ServiceType>
3. The HTML view of the service will list the default values for Max upload file size and Allowed upload file types. Make a note of the default properties.
4. Edit the service.
5. Update the property maxUploadFileSize property with a desired maximum allowed size in megabytes (MB).
6. Update the property allowedUploadFileTypes property by specifying a comma separated list of file extensions (e.g.: jpg,png,tif)
0 Kudos
AlexeyTereshenkov
Deactivated User
Jack, glad you found it. I did not expect you specifying the file extensions list on server level since I thought you need to implement it on application level. In ArcGIS Server 10.1, you can for sure define some configuration for the Uploads operation including but not limited to file size and file extension type.

Good luck!
0 Kudos