Opened 16 years ago
Closed 16 years ago
#2635 closed Bug (duplicate)
asp connector link quickupload adds extra slash
Reported by: | John Crowley | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
To reproduce, select some text, use the add link button, then switch the tab to the quick upload, and upload a file. Switch back to the an extra / character is inserted into the path.
I found that the value of "currentFolder" was a backslash. The CombinePaths function was appending a forward slash, then a second call to CombinePaths inserted an extra / again. The value of the path became <dir>\<filename>. This caused the url to display as <dir><filename>.
The fix I applied was to test currentFolder for a "\" and convert it into a "/" in commands.asp.
So I added one line to the end of FileUpload() in filemanager/connectors/asp/commands.asp.
I only use the asp version, so I did not test if this bug exists in other versions.
Also, I noticed that if you use the browser to upload and select a file, the path is urlencoded, but if you use the quickupload, the path is raw. Not a big deal, but inconsistent.
Code for my fix follows:
Set oUploader = Nothing
dim sFileUrl
if currentFolder = "\" then currentFolder = "/" ' ADD THIS LINE
sFileUrl = CombinePaths( GetResourceTypePath( resourceType, sCommand ) , currentFolder ) sFileUrl = CombinePaths( sFileUrl , sFileName )
SendUploadResults sErrorNumber, sFileUrl, sFileName, ""
dup of #2611.