<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set filename for export web map task (print) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1356496#M83003</link>
    <description>&lt;P&gt;The print service doesn't actually accept a custom file name for the file it generates.&amp;nbsp; Instead, the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html" target="_self"&gt;Print widget&lt;/A&gt; works by using the link element's &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download" target="_self"&gt;download&lt;/A&gt; property to tell the browser to save the output file with a different name.&lt;/P&gt;&lt;P&gt;You can reproduce this just using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html" target="_self"&gt;print&lt;/A&gt; module with something like the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;print.execute(url, printParameters).then(function(dataFile) {
	fetch(dataFile.url).then(function(response) {
		response.blob().then(function(blob) {
			var a = document.createElement("a");
			a.style.display = "none";
			a.href = window.URL.createObjectURL(blob);
			a.target = "_blank";
			a.download = "MyFile" + dataFile.url.substring(dataFile.url.lastIndexOf("."));
			document.body.appendChild(a);
			a.click();
			a.remove();
			a = null;
		});
	});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2023 19:24:46 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-12-04T19:24:46Z</dc:date>
    <item>
      <title>How to set filename for export web map task (print)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1356078#M82994</link>
      <description>&lt;P&gt;I am using the "print" task.&amp;nbsp; Not to be confused with the print widget.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN class=""&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; * &lt;/SPAN&gt;&lt;SPAN class=""&gt;as&lt;/SPAN&gt;&lt;FONT size="4"&gt;&lt;SPAN&gt;&lt;STRONG&gt; print&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core/rest/print.js&lt;/STRONG&gt;&lt;/FONT&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The documentation says this:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If the application and the print service are on the same origin, the name of the downloadable file can be customized with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#fileName" target="_blank" rel="noopener"&gt;fileName&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-TemplateOptions.html#title" target="_blank" rel="noopener"&gt;title&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;properties. If not, the name of the downloadable file will be generated by the ArcGIS Enterprise that hosts the print service.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;But there is not a property called fileName or title on print.&amp;nbsp; On the print widget, I saw TemplateOptions which had this property, but not on print.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I set the download filename???&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 14:39:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1356078#M82994</guid>
      <dc:creator>BradBarnell</dc:creator>
      <dc:date>2023-12-02T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to set filename for export web map task (print)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1356496#M83003</link>
      <description>&lt;P&gt;The print service doesn't actually accept a custom file name for the file it generates.&amp;nbsp; Instead, the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html" target="_self"&gt;Print widget&lt;/A&gt; works by using the link element's &lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/download" target="_self"&gt;download&lt;/A&gt; property to tell the browser to save the output file with a different name.&lt;/P&gt;&lt;P&gt;You can reproduce this just using the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-print.html" target="_self"&gt;print&lt;/A&gt; module with something like the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;print.execute(url, printParameters).then(function(dataFile) {
	fetch(dataFile.url).then(function(response) {
		response.blob().then(function(blob) {
			var a = document.createElement("a");
			a.style.display = "none";
			a.href = window.URL.createObjectURL(blob);
			a.target = "_blank";
			a.download = "MyFile" + dataFile.url.substring(dataFile.url.lastIndexOf("."));
			document.body.appendChild(a);
			a.click();
			a.remove();
			a = null;
		});
	});
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1356496#M83003</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-12-04T19:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to set filename for export web map task (print)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1357124#M83023</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;has the correct answer. I think the print known limitations doc should be updated to be more accurate for this scenario.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-set-filename-for-export-web-map-task-print/m-p/1357124#M83023</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2023-12-05T21:35:32Z</dc:date>
    </item>
  </channel>
</rss>

