Skip to main content

I try to implement a zip and download functionality that reads out a folder on azure and zips the files inside that folder.

There are the following steps :

 

  1. Decision that either selects the next folder to zip or ends the process when there is no folder left to zip. This decision sets a process variable with the name of the folder. (not shown in the picture)
  2. This folder name is used as input for the zip process action.
  3. One of the output fields of the zip action is the file_data, which is assigned to a process variable that has the var_binary(max) datatype.
  4. This var_binary variable is the used as input for the download action that also takes the filename of the eventual file that is downloaded.

 

The download itself seems to be working as in that a ‘save as’ form is shown with the correct filename that can then be saved on the local machine.

However, the file that is created is empty.

 

The zip functionality itself does not give any errors (status code 0 is returned) and the file_data output parameter is set but the binary data output that I can see in the process flow monitor is only 22 bytes big, which seems to suggest to me that this part already goes wrong, since I expect the data to be a bit bigger.

The input parameter of the zip action indicates that only a folder of filename is needed and that thus no additional steps are needed that proceed the zip action. The binary data output seems to suggest that we can do this in memory and put the data then inside the download functionality without having to save the zip file first.

When I fill in a folder name, I expect the content of this folder to be zipped and stored in the binary data output parameter.

Is that assumption wrong?

 

additional data: 

  • the folder is a folder on an azure storage location. 
  • The functionality is accessed via the browser.

 

 

Has anyone got any experience with using the zip functionality? If so, please share your thoughts.

 


It should work like that, i did a small test with 2 txt files and it works like a charm. Since you mention the filesize should be bigger, this could perhaps be a timeout issue or a file size problem. If you test a smaller file/folder does it work like you would expect? 

 

 


When I mentioned the filesize, I meant that I expected it to be bigger than just 22 bytes. 

The files I try to zip are a few kB in size and for testing purposes, there are only a few of those in each folder.

 

 


You mentioned Azure. Is there a possibility to test this with an on-premise location? And are you sure the indicium pool user has read/write rights on the azure location?


There are various other functionalities in the system that use the azure environment, so my guess would be that this is not the issue. 

And if it was, wouldn't you expect to get an error message in return? 


I would probably expect an error, but since I have limited knowledge on Azure I don’t know how to debug this any further. 

Perhaps someone else on the community can help you with this. 

 


Hello ​@s.vermeulen,

The result you're describing (no error, status code 0 and a result of 22 bytes) is consistent with specifying a folder to zip, but the folder being empty.

  1. Decision that either selects the next folder to zip or ends the process when there is no folder left to zip. This decision sets a process variable with the name of the folder. (not shown in the picture)
  2. This folder name is used as input for the zip process action.

I'm assuming that the folder name that you're using as input is a valid, absolute path to the folder, since you'd get an error message otherwise.

My best guess is that the input folder doesn't exist or is empty. Can you double check the values that you're using as input and confirm that they're existing, non-empty folders?

If this didn't help, you could try the List Folder process action, as the Zip File process action uses the List Folder implementation to obtain the source files for the zip archive. I suspect that the List Folder process action would return no results for the folder, which will take us one step closer to the root cause of this problem.

I hope this helps.


I have added a list folder process step and this returns the following json : 

 

folder list step

 

input-parameter: 

xxxxxxx/001500000-001599999/Case_01523936/

 

output

{
  "Path": "xxxxxxx/001500000-001599999/Case_01523936?sv=2022-11-02&ss=bfqt&srt=sco&spr=https,http&st=2023-11-01T09%3A32%3A55Z&se=2025-11-01T17%3A32%3A55Z&sp=rwdlacupiytfx&sig=eczORaqHj%2BrNGkat6qUZPI70WB3BG%2FCy9qekaxQcHys%3D/test.docx",
  "Name": "test.docx",
  "IsFolder": false
}

 

the bold part in both is my azure storage folder which I have replaced with x to show here. 

It does show the actual test file I put in there. ("Name": "test.docx")

What I do find strange is the data shown in the path after the ? and I don't know if that is correct.

 

 

zip step

 

The zip file input parameter is the same folder name I used for the list folder step.

 

input: 

xxxxxxx/001500000-001599999/Case_01523936/

 

output: 

 

 

Downloading that data still is an empty zip file.

 

 

PS: 

Why is it needed to add the storage location in the form part of the process step, if I have to enter the full path into the input parameter anyway?

 

 


Reply