Attachments on server but not on device

1973
18
11-08-2011 08:54 PM
AHay
by
New Contributor III
i have made a map to view on the esri ios app with editing and attachments enabled, all is good can edit and add attachments but when i come back into app the attachments images are blank.

the images do get sent to server but they will not open from desktop / catalog i can only see then if i save to a folder then open from folder.

i fixed all the virtual paths to output and cache folders but still cannot see in app

any ideas anyone?
0 Kudos
18 Replies
RussRoberts
Esri Notable Contributor
There is a problem with your outputs I think. I would post this question on the server forum or contact support to see if they can help you solve this issue.

Thanks
Russ
0 Kudos
AHay
by
New Contributor III
Matt,
i can see the names of the files by clicking feature with identify tool when i click on attachments link , the window open but when click on name nothing happens, i can then save the file to a location and then i can open.  i get no errors

Also Matt you said you could see you attachments in you outputs folder, all of my output folders are empty?? is that normal?
0 Kudos
MatthewFletcher
Occasional Contributor
Hay,
There's a cleanup schedule you can set for the output folder.  Maybe the images were deleted via a cleanup. 

In ArcCatalog, right click on an Admin connection to your ArcServer connection - click "Server Properties" - Directories tab - select output directory - edit button.  There's a Max File age and cleaning mode setting you can check.

Take a picture with the ESRI app, save it to your server and see if anything's written to the output folder.

I had some issues with saving attachments to the server before, which stemmed from IIS.  When the issues existed, I was receiving errors on the ESRI app when saving the attachment to the server.

Matt
0 Kudos
MatthewFletcher
Occasional Contributor
Hay,
I spoke with Tech support about this issue.  The attachments not being available on the iPad has to do with our network setup.  Forgive me, I'm not a network guy, so i don't fully understand it.

Our GIS server is in a NAT subnet which is some how creating a loop.  The way I understand it, the loop isn't created until the iPad is disconnected from the GIS Server.  When the iPad is reconnected to the GIS server and the attachment is requested, the loop exists, not letting the attachment out and onto the iPad. 

ESRI also said I should use ArcGIS Server to implement security vs. however we were doing it via the network.

Sorry I don't have any more specifics.  Working with our network guy, hoping he figures it out.
0 Kudos
CsabaHuszár
New Contributor
hi
can you help me? I have to use attachment but it didn't work for me.

I can send new data for the server:

AGSPoint *point=[[AGSPoint alloc]initWithX:11.11 y:22.22 spatialReference:self.featureLayer.spatialReference];
    AGSGraphic *graphic= [[AGSGraphic alloc]initWithGeometry:point symbol:nil attributes:attributes infoTemplateDelegate:nil];
    NSArray *array = [[NSArray alloc]initWithObjects:graphic, nil];
    [self.featureLayer addFeatures:array];

But I can't get the graphic(what i'm uploaded) ObjectID from the server so I cant upload a picture.


One more problem: if I fill the ObjectID field with a correct number(814) I get error when I make an AttachmentManager.

AGSGraphic* feature = [featureLayer lookupFeatureWithObjectId:814];
AGSAttachmentManager* attMgr = [featureLayer attachmentManagerForFeature: feature];


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil key'
***



What is the solution? Thanks for the answer!
0 Kudos
AHay
by
New Contributor III
Matt,

wow that is an interesting resolution, don't really understand it but sounds feasible.  please let me know how you go
0 Kudos
NimeshJarecha
Esri Regular Contributor
Csaba,

Your question is very much different than the original post in this thread. Hence, I would suggest creating a new thread.

Since, you are creating a new feature. You must wait until it's successfully added to server and then only you can add attachment. Here are the steps you should follow...

1. Adopt AGSFeatureLayerEditingDelegate delegate.
2. Set self.featureLayer.editingDelegate = self;
3. Add features with [self.featureLayer addFeatures:array]; and wait for the result (success or failure) in the editing delegate methods.
4. If successes, the result is returned in featureLayer:operation:didFeatureEditsWithResults: method. You'll get a new object id.
5. Now, you can do following and post the attachment.

AGSGraphic* feature = [featureLayer lookupFeatureWithObjectId:<newObjectId>];
AGSAttachmentManager* attMgr = [featureLayer attachmentManagerForFeature: feature];

Hope this helps!

Regards,
Nimesh

Regards,
Nimesh
0 Kudos
MatthewFletcher
Occasional Contributor
Hay,
I finally got my attachments to pull onto the iOS app.  It took two additional steps:

1.)  My network guy took the loop out of our subnet.
2.)  I was still getting 401 unauthorized errors when accessing image attachments via REST.  I found this article http://support.esri.com/en/knowledgebase/techarticles/detail/37316 detailing how to fix the same error for a Business Analyst issue.  I followed the directions, enabling anonymous access for the ArcGISOutput folder, now everything works.

Matt
0 Kudos
AHay
by
New Contributor III
Matt,

thanks for the response but this is not the issue for us.  We are using iis 7 and Anon Auth is enabled by default plus i thought i would check  and it is enabled.

i dont get any errors when i attempt to attach a file (arcgis server nor event viewer errors) , its just that nothing happens, i think it must be with our proxy setup.

ESRI support have been very helpful on this and we will be looking closely at our proxy in the new year

thanks again a matt for all your input into this
have a great XMAS break
0 Kudos