
Anonymous
Not applicable
2008-07-11
08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
URL encode
hi,
i will be getting a value from database and put the value in the url of the FileFetch step and downloading the file.
will it be possible to encode url for the value fetched from the database.
please help.
thanks
jayanth
i will be getting a value from database and put the value in the url of the FileFetch step and downloading the file.
will it be possible to encode url for the value fetched from the database.
please help.
thanks
jayanth
705 Views
2 Replies

Specialist III
2008-07-11
09:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Don't know why you want to encode the URL for tFileFetch, but here's how it should work:
Put java.net.URLEncoder.encode(yourString, "UTF-8") around the string you want to encode. Tested inside a tMap, works fine (for example "www.test.de/index.php?t=1&m=2" becomes "www.test.de%2Findex.php%3Ft%3D1%26m%3D2").
Regards,
Theo
Put java.net.URLEncoder.encode(yourString, "UTF-8") around the string you want to encode. Tested inside a tMap, works fine (for example "www.test.de/index.php?t=1&m=2" becomes "www.test.de%2Findex.php%3Ft%3D1%26m%3D2").
Regards,
Theo
705 Views

Anonymous
Not applicable
2019-03-21
06:40 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thats a really old post, but i ran into the same problem and want to share my solution.
User often choose weird filenames, thats why i want to handle it this way.
It seems that the encode methode is not really designed to encode a URL in the way we need it here for WebDAV.
For example, a space in filename will be encoded to "+" instead of "%20". I searched a lot and at the end i give up and use a little workaround.
Important thing: Don't encode the entire URL, in my case i encode the filename only and it works.
globalMap.put("URI",java.net.URLEncoder.encode(((String)globalMap.get("Filename")),"UTF-8").replace("+", "%20"))
regards
Lars
705 Views
