Opened 15 years ago

Closed 15 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:


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, ""

Change History (1)

comment:1 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Resolution: duplicate
Status: newclosed

dup of #2611.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy