Select to view content in your preferred language

How to allow local file upload with the Analysis widget using a Custom web tool published from a Notebook (ArcGIS Online)

452
4
01-14-2025 11:05 AM
Labels (1)
PatricePineaultWSP
New Contributor

In an experience builder, I need to allow users to upload an Excel file for further processing in a notebook published as a Custom web tool.

I created a notebook, configured the input parameters with a "file" type, declared it in the notebook code and published it.

In Experience Builder, I configured the analysis widget to use the published Custom web tool.

However, when configuring the Analysis widget, the checkbox "Allow local file upload" was disabled in the input parameter for the file.

I discovered that I could edit the json service file for the web tool (webtoolService.json) using ArcGIS Assistant and allow uploads with

"capabilities": "Uploads".

I can now enable the "Allow local file upload" option in the widget and I can click on the "upload" button then choose a local file to upload from my computer (small 1kb csv file). But when I do, I get the error:

"Error performing upload operation, file size or type not supported for this service"

What am I missing? I swear I could do this operation like 4-5 weeks ago when exploring the functionalities of notebooks and analysis widget.

0 Kudos
4 Replies
Wei_Ying
Esri Regular Contributor

@PatricePineaultWSP Thanks for reaching out. Some questions: 
1. What version of ExB are you using? 
2. What type of the file you are trying to upload? 
3. Can you check your web tool service's admin point see its allowing file types and max file size.
Such as "https://domainname/server/admin/services/Tooname.GPServer"

Wei_Ying_0-1737075947105.png

 

0 Kudos
PatricePineaultWSP
New Contributor

Hi,

  1. 1.16.0
  2. At the moment, CSV. But need it to  be XLSX
  3. https://notebooksservices3.arcgis.com/admin/services/<myToolId>.GPServer There are no properties about "Max upload file size" or "Allowed upload file types"

 

0 Kudos
Wei_Ying
Esri Regular Contributor

CVS and XLSX are supported to be upload as long as your gp service allow to do so.
You have to check with the gp service on server admin side, such as. Please contact your server admin maybe to help verify the supported type for the gp service you are using. 

Wei_Ying_0-1743108148460.png

 

0 Kudos
MarcHoogerwerf_EsriNL
Esri Contributor

Hi Wei Ying,

I'm trying to do a similar thing from a WebTool published from an ArcGIS Online Notebook. However, the services directory seems to be disabled for the WebTools published from online notebooks. Is this a permission issue or is it disabled across the board? Is there any way to enable local file uploads to a Webtool?

MarcHoogerwerf_EsriNL_0-1746170839057.png

Currently this is a showstopper for a customer who is planning to move their entire GIS operation from ArcGIS Enterprise to ArcGIS Online. A common workflow in many of their domains is allowing users to upload project files (Excel, CSV, images, CAD files) to a GP service that process them and adds the results to a company wide repository (hosted feature layers, image mosaics, oriented imagery layer, etc).

I've updated webtoolService.json with entries for capabilities, maxUploadFileSize and allowedUploadFileTypes

{
    "currentVersion": 11.4,
    "cimVersion": "2.9.0",
    "serviceDescription": "uplolad excel",
    "executionType": "esriExecutionTypeAsynchronous",
    "resultMapServerName": "",
    "maximumRecords": 1000,
    "capabilities": "Uploads",
    "maxUploadFileSize": 2000,
    "allowedUploadFileTypes": "xlsx,xls",
    "tasks": [
        "Upload_Excel"
    ],
    "serviceUrl": null,
    "timeoutInMinutes": 15
}

 

So allow local file upload is now enabled in Experience Builder

MarcHoogerwerf_EsriNL_0-1746193724577.png

 

But I'm getting this error when selecting a small .xlsx from my local machine

MarcHoogerwerf_EsriNL_1-1746193900923.png

 

Am I missing something?

0 Kudos