I'm building a widget in a WAB template that sends a geotagged photo to a Python toolbox GP service to create a point with the coordinates and attach the photo.

I send the request to upload:

var requestID = request({
    url: "sampleurl",
    content: { f: "pjson" },
    form: dojo.byId("uploadForm"),
    handleAs: "json"

Receive a successful response:

Upload Success:  
{success: true, item: {…}, _ssl: undefined}
committed: true
date: 1553539769324
description: null
itemID: "i697e97a0-7caa-4bac-9a5f-6e3da8ae8249"
itemName: "P_20190312_104511_gps_lig.jpg"
serviceName: "DEMO/UploadPhotoGeo.GPServer"
__proto__: Object
success: true
_ssl: undefined
__proto__: Object

Then I get the itemID and set the parameters and submit job:

    function (response) {

        console.log("Upload Success: ", response);

        itemID = response.item.itemID;

        nomeItem = response.item.itemName;

        params = {
            "in_x": String(x_decimal),
            "in_y": String(y_decimal),
            "in_z": String(z.valueOf()),
            "in_NIS": null,
            "in_idProcDet": null,
            "in_obs": null,
            "in_upDate": null,
            "in_photoDate": fulldate,
            "in_or": null,
            "in_owner": null,
            "in_att": itemID,
            "in_fn": nomeItem

        var gpJob = gpTask.submitJob(params, completeCallback, statusCallback);

            function (response) {
                console.log("GP Success: ", response);
            }, function (error) {
                console.log("GP Error: ", error.message);

In my Python toolbox, this specific parameter is defined as:

# Eleventh parameter - Attachment
param10 = arcpy.Parameter(
    displayName="Input Attachment",

And retrieved here:

foto = parameters[10].valueAsText
fotoNome = parameters[11].valueAsText
if (foto <> None):
    arcpy.AddMessage('Foto: ' + str(foto))

But I am receiving a message of a null parameter:

description: "Foto: None"
type: "esriJobMessageTypeInformative"
__proto__: Object

And the script does not create the point or save the photo:

description: "Gravando foto no drive f: must be string or buffer, not None"
type: "esriJobMessageTypeInformative"

Am I missing something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.