younginnovations / aidstream-old

[Deprecated] AidStream is a platform for small and medium size NGOs to publish their aid data in IATI standard.
http://aidstream.org
3 stars 13 forks source link

documentlink with spaces in file name #85

Closed stevieflow closed 10 years ago

stevieflow commented 10 years ago

If a user uploads a document that has spaces in the filename, they can insert the file in as a document-link URL, but AidStream then doesnt recognise this as a URL:

index

AidStream should render any such file names into URLs that have such spaces (and possibly characters) escaped

geshan commented 10 years ago

good idea.

mesaugat commented 10 years ago

This is done to prevent users from entering two or more links on a single field. For example: http://aidstream.org, http://example.com would be valid, which was stated back in #65

We can encode the file name into URLs for documents uploaded to AidStream. But for other URL's with spaces or invalid characters in between it could be difficult. This will also make the above example a valid URL which was the previous case. Any ideas ?

stevieflow commented 10 years ago

Thanks - I can see what you mean.

For files that are uploaded via Aidstream, could they be encoded into valid URLs (as in URLs without spaces)?

In terms of users who then add URLs that include spaces, then perhaps this rests in a guidance / tooltip to alert them? And / or - I guess AidStream could escape spaces in URLs once they are submitted by the user - but this might need more logic building in. Perhaps guidance is the best solution in this case.

mesaugat commented 10 years ago

Yes, those files which are uploaded to AidStream can be encoded into valid URL's without spaces. Escaping spaces is not right. For other invalid URL's providing guidance seems to be right.

stevieflow commented 10 years ago

Yes, sorry - my typo for suggesting "escape spaces"

mesaugat commented 10 years ago

Fixed with current update (v1.3.1). However, spaces are not allowed in URL and a error message stating that will be shown if the user inserts an invalid URL with spaces or other invalid characters.