# CDF for serializing XLSX

**URL:** <https://community.wolfram.com/t/cdf-for-serializing-xlsx/22512>\
**Category:** Questions\
**Tags:** computable-document-format, import-and-export, wolfram-cloud\
**Created:** [July 19, 2023, 11:20am UTC](https://community.wolfram.com/t/cdf-for-serializing-xlsx/22512 "2023-07-19T11:20:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hifismith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hifismith/32/7587_2.png) [@hifismith](https://community.wolfram.com/u/hifismith)\
**Post date:** [July 19, 2023, 11:20am UTC](https://community.wolfram.com/t/cdf-for-serializing-xlsx/22512/1 "2023-07-19T11:20:20Z")

</div>

I have some code that takes spreadsheets in a specific format, and breaks them into CSVs. This isn’t easily deployed to Wolfram Cloud since the output is a folder of CSVs, and I would prefer to have the serialization to happen in the same folder as the source file.

Since I don’t have Enterprise Mathematica, what options are there to share this tool with others? CDF doesn’t allow me through FormPage or InputField to use a file as an input.

---

<div class="post-metadata">

**Author:** ![robpacey](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@robpacey](https://community.wolfram.com/u/robpacey)\
**Post date:** [November 2, 2025, 10:06pm UTC](https://community.wolfram.com/t/cdf-for-serializing-xlsx/22512/2 "2025-11-02T22:06:13Z")

</div>

Eric,

The limitation you’ve hit is correct: **CDF Player/Free CDF** intentionally blocks file system access to prevent arbitrary code execution on the end-user’s machine.

This means you cannot use `InputField` or `FormPage` in a CDF to browse for a local file and then save multiple output files to the same location.

**Alternative Deployment and Sharing Options**

**A) Cloud-Based Solution**

Use the Wolfram Cloud to handle the file operations then compress the multiple CSV outputs into a single ZIP file for the user to download.

**Tool Structure**

You can use the `APIFunction` or a `FormFunction` to manage the process entirely on the Cloud.

**Input**

Use `FormFunction` with the parameter type `"UploadedFile"` for the user to upload the XLXSX file.

**Process**

The function processes the uploaded file’s data and generates a list of CSV files in the Cloud’s temporary directory.

**Compress**

Use `CreateArchive` to combine all generated CSVs into a single `.zip` file.

**Output**

Use `Export` with the `"Attachment"` option to force the browser to download the resulting ZIP file.

**Example Code**

```
CloudDeploy[
 FormFunction[
  {"Spreadsheet" -> "UploadedFile"},
  Module[{data, sheetNames, tempDir, archivePath},
   (* 1. Import all sheets from the uploaded file *)
   data = Import[#Spreadsheet, {"XLSX", "Data", All}];
   sheetNames = Import[#Spreadsheet, {"XLSX", "SheetNames"}];
   
   (* 2. Create a temporary folder in the cloud for the CSVs *)
   tempDir = CreateDirectory[FileNameJoin[{$TemporaryDirectory, "CSVs"}]];
   
   (* 3. Export each sheet as a separate CSV file *)
   MapIndexed[
    Export[FileNameJoin[{tempDir, sheetNames[[#2[[1]]]] <> ".csv"}], #1] &,
    data
   ];
   
   (* 4. Create a ZIP archive of the entire temporary folder *)
   archivePath = CreateArchive[tempDir, "Serialized_CSVs.zip", "ZIP"];
   
   (* 5. Deliver the ZIP file as a browser download *)
   Export[archivePath, "Attachment"]
  ],
  "Download"
 ]
]

```
