Tested uploading an experiment file whose filename contained # and confirmed I could download it again
Also tested a horrible file with name: Generic Special Chars ! @ # $ % ^ & * ( ) - _ = + [ ] { } | \ / < > ' " ? ,.xlsx. This filename gets clobbered during the upload, and gets saved to the ACAS filestore as : < > ' %22 ? ,.xlsx, which is a related but separate bug. Before this fix, that file could not be downloaded from the experiment browser, and after the fix it can be downloaded successfully.
Description
I dug into this a little more and found that there are some subtle differences between
encodeURI
which is meant to encode an entire URL / URI andencodeURIComponent
which is meant to encode a query string or path component in a URL. For more info: https://stackoverflow.com/questions/75980/when-are-you-supposed-to-use-escape-instead-of-encodeuri-encodeuricomponentI found that a simple switch to encoding only the
fileValue
withencodeURIComponent
fixes the issue with#
characters.Related Issue
https://schrodinger.atlassian.net/browse/ACAS-761
How Has This Been Tested?
#
and confirmed I could download it againGeneric Special Chars ! @ # $ % ^ & * ( ) - _ = + [ ] { } | \ / < > ' " ? ,.xlsx
. This filename gets clobbered during the upload, and gets saved to the ACAS filestore as: < > ' %22 ? ,.xlsx
, which is a related but separate bug. Before this fix, that file could not be downloaded from the experiment browser, and after the fix it can be downloaded successfully.