laptop and a wrench

Bug

FeatureLayer.addAttachment() is returning the HTML response with a feature service hosted on an enterprise environment.

Zuletzt veröffentlicht: January 22, 2019 ArcGIS API for JavaScript
Bug-ID-Nummer BUG-000118713
EingereichtDecember 10, 2018
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS API for JavaScript
Gefunden in Version4.9
BetriebssystemWindows OS
Betriebssystemversion10.0 64 Bit
StatusNon-Reproducible

Zusätzliche Informationen

When using a multi-part post to send the file data, all parameters of the request have to be passed in the body of the request in the correct form. This includes the format (f) parameter which is not to be included in the querystring.

Workaround

Add the following bolded line of code to the HTML form:

<form id="importFileForm">

   Upload a file: <input type="file" name="attachment" id="fileinput">

   <input type="hidden" name="f" value="json">

 </form>

Or if using FormData class use the following code:

let form = new FormData();

form.set("attachment",file);

form.append("f","json");

Schritte zur Reproduzierung

Bug-ID: BUG-000118713

Software:

  • ArcGIS API for JavaScript

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln