<?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: arcgisjobs URL in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433706#M16740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I guess two things to check here -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) how does the script pass the output back? I assume you have an output parameter of File (which maps to GPDataFile) in REST. Inside the script you have something like &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SetParameterAsText(10, myPDFoutputVar)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How are you consuming it where it doesn't come back? Sounds like REST or a web application. If you consume your service back in Desktop, can you open the Results window and double click the output under the service result to open the PDF? If you can, then everything you've done in question 1 above is correct. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These two arcgis.com links have nice simple web applications which you could use to compare against your code to see if you're asking for the PDF back correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=442e1c7ff64240af8f41825f567e60d0"&gt;http://www.arcgis.com/home/item.html?id=442e1c7ff64240af8f41825f567e60d0&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de"&gt;http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2012 14:48:59 GMT</pubDate>
    <dc:creator>KevinHibma</dc:creator>
    <dc:date>2012-11-21T14:48:59Z</dc:date>
    <item>
      <title>arcgisjobs URL</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433705#M16739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I've been trying to figure out the URL to download a PDF that I create in a GP Script that gets put into the Jobs folder. I can see that PDF in the folder but I cannot figure out the URL to download it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Physical Path:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;D:\arcgisserver\directories\arcgisjobs\gptasks\createpdf_gpserver\jdbb9112ceca04162ba591391b5151305\scratch\EditorMap_20121120_141837.pdf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I think the URL should be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://sitehost:6080/arcgis/rest/directories/arggisjobs/gptasks/createpdf_gpserver/jdbb9112ceca04162ba591391b5151305/scratch/EditorMap_20121120_141837.pdf" rel="nofollow" target="_blank"&gt;http://sitehost:6080/arcgis/rest/directories/arggisjobs/gptasks/createpdf_gpserver/jdbb9112ceca04162ba591391b5151305/scratch/EditorMap_20121120_141837.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the help I think this should do it. I always get an "Error Code:500" back from the ArcGIS REST Framework. What am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 21:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433705#M16739</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2012-11-20T21:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcgisjobs URL</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433706#M16740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I guess two things to check here -&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) how does the script pass the output back? I assume you have an output parameter of File (which maps to GPDataFile) in REST. Inside the script you have something like &lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.SetParameterAsText(10, myPDFoutputVar)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How are you consuming it where it doesn't come back? Sounds like REST or a web application. If you consume your service back in Desktop, can you open the Results window and double click the output under the service result to open the PDF? If you can, then everything you've done in question 1 above is correct. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;These two arcgis.com links have nice simple web applications which you could use to compare against your code to see if you're asking for the PDF back correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=442e1c7ff64240af8f41825f567e60d0"&gt;http://www.arcgis.com/home/item.html?id=442e1c7ff64240af8f41825f567e60d0&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de"&gt;http://www.arcgis.com/home/item.html?id=8f16fdeef39c46b3952002b2d85ea5de&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 14:48:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433706#M16740</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-11-21T14:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcgisjobs URL</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433707#M16741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, this is an Asynchronous GP Task run from the JS API and I need to pass the PDF URL back as an output parameter. I am doing just what you show above but I don't know how to get the URL of the "arcgisjobs" folder to set the "myPDFoutputVar".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My app is similar to the 2nd example above but I need to make the PDF available from a URL not just copy it to C:\Temp. I thought that the "arcgisjobs" folder was supposed to be web accessible.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 16:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433707#M16741</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2012-11-21T16:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: arcgisjobs URL</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433708#M16742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You dont have to pass any URLs in your Python code -all the parameter output locations between the service and the REST are handled by the framework.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By setting a file as the output type in your Python script / tool, (using the SetParameterAsText), it just comes back. You dont need to worry about URLs and virtual directories here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a tool that runs fine inside ArcMap and returns a PDF, and then you publish it as a service and THAT runs fine when you consume it in ArcMap, you've done everything you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All you need to do is to get the output in your javascript application. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the first link's web application, the code to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function gpJobComplete(jobInfo) { &amp;nbsp;&amp;nbsp;&amp;nbsp; if (jobInfo.jobStatus == "esriJobSucceeded") &amp;nbsp;&amp;nbsp;&amp;nbsp; { gp.getResultData(jobInfo.jobId, "Output"); } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showDialog(dojo.string.substitute('&amp;lt;a href=${url} target="_blank"&amp;gt;Job failed&amp;lt;/a&amp;gt;', { url: gp.url + "/jobs/" + jobInfo.jobId }));&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } }&amp;nbsp; function gpResultDataComplete(result) { &amp;nbsp;&amp;nbsp;&amp;nbsp; showDialog(dojo.string.substitute('&amp;lt;center&amp;gt;&amp;lt;a href=${url} target="_blank"&amp;gt;Download Map&amp;lt;/a&amp;gt;&amp;lt;/center&amp;gt;', { url: result.value.url })); }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 16:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433708#M16742</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-11-21T16:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: arcgisjobs URL</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433709#M16743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Arg, okay. That has never been obvious to me that you just set the output parameter to type File and ArcServer would return the URL to the file. I wish that there were more ways to do the same thing. Something like the following would make more sense in my feeble mind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;outfldr = arcpy.env.scratchWorkspaceUrl&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dave&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 18:22:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcgisjobs-url/m-p/433709#M16743</guid>
      <dc:creator>DaveHighness</dc:creator>
      <dc:date>2012-11-21T18:22:15Z</dc:date>
    </item>
  </channel>
</rss>

