cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with maintaining original file types when downloading and extracting zip files in Alfresco

Hariharan
Champ in-the-making
Champ in-the-making

I'm utilizing the endpoint http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/6e0c74d4-cd08-4fb6-9a8... in Alfresco to download files.

Subsequently, I've created a new download operation using http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/downloads. However, after monitoring the download status and completing the download process, I've observed that the downloaded .zip file contains all files in a generic format, rather than preserving their original formats.

My expectation is that the files within the downloaded zip should retain their original formats.

How can I ensure that the downloaded files maintain their original formats within the zip archive?

1 ACCEPTED ANSWER

Hariharan
Champ in-the-making
Champ in-the-making

Issue Resolved: Ensuring File Extensions for Uploaded Files

Thanks for the reply!

I'm pleased to inform you that the issue has been successfully resolved. By ensuring that the filenames of uploaded files include their respective file extensions, we've ensured that when these files are downloaded as a zip archive, they retain their original file formats.

View answer in original post

2 REPLIES 2

BookerE1
Champ in-the-making
Champ in-the-making

@Hariharan wrote:

I'm utilizing the endpoint http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/6e0c74d4-cd08-4fb6-9a8... in Alfresco to download files.

Subsequently, I've created a new download operation using http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/downloads. However, after monitoring the download status and completing the download process, I've observed that the downloaded .zip file contains all files in a generic format, rather than preserving their original formats.

My expectation is that the files within the downloaded zip should retain their original formats.

How can I ensure that the downloaded files maintain their original formats within the zip archive?


Hello,

I understand that you have a problem with the downloaded files from Alfresco not preserving their original formats within the zip archive. This problem may be caused by the way Alfresco handles the file names and extensions when creating the zip archive. Alfresco uses the node ID as the file name and the MIME type as the file extension, which may not match the original file name and extension. Therefore, you may need to rename the files manually or use a script to restore their original formats after downloading them.

Alternatively, you can try to use a different method to download the files from Alfresco, such as:

  • Using the Alfresco Share interface: You can use the Alfresco Share interface to download the files from Alfresco. You can select the files that you want to download and click on the Download as Zip button. This will create a zip archive that preserves the original file names and extensions.
  • Using the Alfresco Content Services REST API: You can use the Alfresco Content Services REST API to download the files from Alfresco. You can use the GET /nodes/{nodeId}/children endpoint to get the list of files under a folder, and then use the GET /nodes/{nodeId}/content endpoint to download each file individually. This will preserve the original file names and extensions.
  • Using the Alfresco WebDAV or FTP protocols: You can use the Alfresco WebDAV or FTP protocols to download the files from Alfresco. You can use a WebDAV or FTP client, such as Cyberduck or FileZilla, to connect to Alfresco and browse the files and folders. You can then download the files or folders that you want. This will preserve the original file names and extensions.

I hope this helps you solve the problem with the downloaded files from Alfresco not preserving their original formats within the zip archive. If you have any other questions or feedback, please let me know. I’m always happy to help.

Best Regard,
DogNeedsBest

Hariharan
Champ in-the-making
Champ in-the-making

Issue Resolved: Ensuring File Extensions for Uploaded Files

Thanks for the reply!

I'm pleased to inform you that the issue has been successfully resolved. By ensuring that the filenames of uploaded files include their respective file extensions, we've ensured that when these files are downloaded as a zip archive, they retain their original file formats.