Gollum: upload filename inconsistency between client/server side

Created on 5 Mar 2015  路  13Comments  路  Source: gollum/gollum

Hi there,

thanks for the awesome work with gollum. I found this little bug, when I drag&drop an image the client side inserts a tag like the following in the text (here I had launched gollum with --allow-uploads page)

[[Home/Screen Shot 2015-03-05 at 2.53.23 pm.png]]

but the uploaded file is rather Home/Screen-Shot-2015-03-05-at-2.53.23-pm.png

so the user ends up with a broken link and possibly a 'lost' file.

bug

Most helpful comment

The fix to this issue will come for free in the upcoming 5.0 release (might be a while though). We've stopped sanitizing filenames in this way (read about it here) from v5 onward, so the discrepancy is no longer there.

I'll close this issue in the mean time to give us a better overview of things we need to address in the upcoming release.

All 13 comments

I notice now that also the commit log is wrong about the filename

Uploaded file to Home/Screen Shot 2015-03-05 at 2.53.23 pm.png

Thanks for reporting this! I won't have time to look at it this month, but a bugfix is more than welcome. The relevant code is here.

I'm having a look and I found another (related) problem, uploading a duplicated file returns status code 200 (see https://github.com/gollum/gollum/blob/master/lib/gollum/app.rb#L209-L212) and the client side ignores the problem. It seems the backend sanitize the name in https://github.com/gollum/gollum/blob/master/lib/gollum/app.rb#L544 but currently there's no way to notify the client side of the new name.

I suppose we need to either mimic the logic of file name sanitization in JS, or else generate the file name through an AJAX call. Thoughts?

I'd say file name sanitization entirely in JS, backend only accepts sanitized name (e.g. via a simple regexp) or refuses the upload.
my 2c

@dometto sorry I had _zero_ time to work on this.

I've found the same issue here -- any word on the progress? I'm hoping to use gollum for scientific/data recordkeeping, so filename inconsistencies on uplaod are a dealbreaker on my end. I'm really impressed with it otherwise though!

Sorry @amccaugh , still hoping someone will have time to come up with a fix. Note that you can always use git to add new files to the repo, so if you would have push access to the wiki you can use git push to add files in a safe manner.

@andreabedini Just checking in. Any prospect of a PR for this issue?

@bartkamphorst nope sorry

No worries, thanks for letting us know!

Status on this issue? I'm starting with gollum and have this bug too. If this from gollum-lib or gollum?

The fix to this issue will come for free in the upcoming 5.0 release (might be a while though). We've stopped sanitizing filenames in this way (read about it here) from v5 onward, so the discrepancy is no longer there.

I'll close this issue in the mean time to give us a better overview of things we need to address in the upcoming release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jb2cool picture jb2cool  路  3Comments

ViChyavIn picture ViChyavIn  路  8Comments

hannahwong picture hannahwong  路  10Comments

snhirsch picture snhirsch  路  4Comments

scribu picture scribu  路  4Comments