Select to view content in your preferred language

Edit Widget & Attachments

2904
15
10-15-2010 12:32 PM
BarrettStanke
New Contributor
When I edit locations within viewer 2.1, all my edits save properly but clicking the link to the attachment opens another window but the file doesn't open and I get a dreaded HTTP 500 Internal Server Error.  How do I go about correcting this?

Also, is there a limit to the size of file you can attach?  Having trouble with anything over 5 MB.
Tags (2)
0 Kudos
15 Replies
BjornSvensson
Esri Regular Contributor
When I edit locations within viewer 2.1, all my edits save properly but clicking the link to the attachment opens another window but the file doesn't open and I get a dreaded HTTP 500 Internal Server Error.  How do I go about correcting this?


What is the URL that it is trying to open? It should probably be similar to something like:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0... ...


Also, is there a limit to the size of file you can attach?  Having trouble with anything over 5 MB.


Yes, both the web server and ArcGIS Services can limit the file size.  Both are configurable.

.NET
The max allowed upload size is the smallest value defined by:
a. <MaxUploadSize>20480</MaxUploadSize> as defined in rest.config.
or
b. ASP .NET Max Request length as defined in web.config
<httpRuntime maxRequestLength=10240" />.
See http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=35971 for more info.

Java
The default max allowed upload size is 20 MB. This can be modified by setting "config.max-upload-size" property in rest-config.properties.

From "Problem: How do I upload large attachments?" in the FAQ:
http://help.arcgis.com/en/webapi/flex/help/index.html#references/faq.htm
0 Kudos
BarrettStanke
New Contributor
What is the URL that it is trying to open? It should probably be similar to something like:
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0... ...

The URL seems to be correct:

http://emrgisviewer.emr-inc.com/ArcGIS/rest/services/CPR/CPR_Data/FeatureServer/2/818/attachments/80...

The linked docs are in a sub folder of the wwwroot\cprr directory where the config.xml and widget files are.  Do I need to move them or should they be somewhere else?


Yes, both the web server and ArcGIS Services can limit the file size.  Both are configurable.

.NET
The max allowed upload size is the smallest value defined by:
a. <MaxUploadSize>20480</MaxUploadSize> as defined in rest.config.
or
b. ASP .NET Max Request length as defined in web.config
<httpRuntime maxRequestLength=10240" />.
See http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=35971 for more info.

Java
The default max allowed upload size is 20 MB. This can be modified by setting "config.max-upload-size" property in rest-config.properties.

From "Problem: How do I upload large attachments?" in the FAQ:
http://help.arcgis.com/en/webapi/flex/help/index.html#references/faq.htm


Got this part to work.  Thanks.
0 Kudos
BjornSvensson
Esri Regular Contributor
There seem to be some authentication issue going on with your web server.

If I navigate to it via the REST Service Directory, I can see that it has one PDF attachment:
http://emrgisviewer.emr-inc.com/ArcGIS/rest/services/CPR/CPR_Data/FeatureServer/2/818/attachments

but when I click the PDF link:
http://emrgisviewer.emr-inc.com/ArcGIS/rest/services/CPR/CPR_Data/FeatureServer/2/818/attachments/80...

I get an "Unauthorized" error:
Server Error - The remote server returned an error: (401) Unauthorized.
Code: 500
0 Kudos
JasonNielsen
Occasional Contributor
There seem to be some authentication issue going on with your web server. 

If I navigate to it via the REST Service Directory, I can see that it has one PDF attachment: 
http://emrgisviewer.emr-inc.com/ArcGIS/rest/services/CPR/CPR_Data/FeatureServer/2/818/attachments

but when I click the PDF link: 
http://emrgisviewer.emr-inc.com/ArcGIS/rest/services/CPR/CPR_Data/FeatureServer/2/818/attachments/80...

I get an "Unauthorized" error: 
Server Error - The remote server returned an error: (401) Unauthorized.
Code: 500


I just started working with attachments on our internal sites and i get the same issue of unauthorized when i attach a file. What base permissions are required to be able to access the attached files?

Thanks..
0 Kudos
BarrettStanke
New Contributor
Did finally get this to work properly.

For future reference, part 1 of the problem was the virtual output directory was pointing to the wrong folder.  Within our GIS server -> server properties -> all virtual directories were pointed to the improper viewer name.  First stopping all map services prior, had to put in the proper viewer name for all 5 directories (Cache, Index, Input, Jobs, and Output).  Then restarting the map services.

Part 2 of the problem was insufficient permissions to the arcgisserver folder for the internet guest account. Fixed by adding this user account (IUSR_) to the list of permissible user names under the folder properties -> security tab.
0 Kudos
AaronBarkhurst
New Contributor
I am having essentially the same problem, however, mine is not an authorization issue. I get an error telling me that there is an Internal Server Error (500). I can go to the url for the attachments and see that they do exist for the feature service, but when I try to access them through a Flex project, I get the Internal Server Error message rather than getting the option to download or view the file. I cannot seem to figure out what I am missing that is causing this problem.....any suggestions?
0 Kudos
FrankRoberts
Occasional Contributor III
I'm having a similar issue getting to the attachments from the Edit widget.  I'm getting the error:

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

The directory it is pointing to is:
http://www.fishcda.com/ArcGIS/rest/services/SampleEdit/FeatureServer/3/411/attachments/2

I can see the attachment being created in my arcgisoutput folder when I click to view the attachment, it is named some crazy long name, but when I open it up on the server is is the image I requested that was an attachment.

I have added the IIS_IUSRS account to have read access the arcgisoutput directory, and the som and soc already have permission.

Any Ideas?
0 Kudos
IvanBaehr
New Contributor
I have created an editable layer and enabled attachement for the feature class in the SDE GDB.

Adding and editing features with the Edit widget works perfect, but no attachment button is displayed in the attribute dialog window. Will I have to enable attachment in the widget config file or something like that?

Ivan Baehr
UNOSAT
0 Kudos
FrankRoberts
Occasional Contributor III
You first may want to check at the rest end point for the feature service and make sure that you see "Has Attachments: True" (this is found about 11 topics-bold text down on the rest end point). 

You then should make sure the you can see popUps for the feature layer.  You will need to configure a PopUp.xml file for it.  This way you can make sure you can get to the attachments.  Make sure you set <showattachments>true</showattachments> in your PopUp.xml. 

If you get the above working then the edit attachments may have a higher chance of working.  Feel free to chime back in if this has already been done and works.
0 Kudos