[SalesForce] Downloading a static resource does not save with extension

I have a csv file as a static resource and i am allowing users to download this file using the following.

<a href="{!URLFOR($Resource.AccountUploadTemplate)}" target="_blank">Click here </a>

enter image description here

The issue i face is that the download file does not have an extension and file type is File when viewed in windows explorer.

enter image description here

Is there anyway we can force it to save with an extension?

Best Answer

I'm not aware of a way that it is possible to force an extension on Static Resources when downloading them. However, you can upload all Static Resources in a Zip File. That way you would know that there is only one extension type for all Static Resources.

Here's the Visualforce mark-up for including a file within a compressed (zipped) Static Resource.

{!URLFOR($Resource.Zip_File_Static_Resource, 'File_Within_Zip_File.js')}
Related Topic