showURL not working with special characters in name

Forum to discuss the Web client version of Servoy.

showURL not working with special characters in name

Postby wouter » Thu May 23, 2019 5:02 pm

Hi,

We have a problem using the application.showURL() method. The problem is with documents uploaded by our users that contain a single quote. The fiels are stored in a unique folder in the webroot and retain their original name.
I turns out the files named with a single quote in them are not shown uring showURL.

We have tried using the original name, escape en encodeURI eacht with different results. None of them cover all situations.

Example file name: "Hello this is sam's example.txt"

/client-documents/6/31B9F5A3-94EF-4732-8019-B70F0090F6AF/Hello this is sam's example.txt (plain)
/client-documents/6/31B9F5A3-94EF-4732-8019-B70F0090F6AF/Hello%20this%20is%20sam%27s%20example.txt (escape)
/client-documents/6/31B9F5A3-94EF-4732-8019-B70F0090F6AF/Hello%20this%20is%20sam's%20example.txt (uriEncode)

Using showURL(fileref) none of the above is downloaded in the browser.

What else can we try?

Regards,

Wouter.
User avatar
wouter
 
Posts: 19
Joined: Mon Jul 23, 2012 1:17 pm

Re: showURL not working with special characters in name

Postby rgansevles » Fri May 31, 2019 9:34 am

Wouter,

URL-encoding should fix this and
application.showURL("/Hello%20this%20is%20sam%27s%20example.txt")

opens fine with me.

Maybe it is an operating system issue, more then a Servoy issue.
Is the file really there with that name and van you open it in a browser with url file:///path.to/Hello%20this%20is%20sam%27s%20example.txt ?

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1907
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL


Return to Servoy Web Client

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

cron