Developer forum

Forum » CMS - Standard features » Is there a way in dw9 to prevent editors from uploading images with filenames containing whitespace or special charachters?

Is there a way in dw9 to prevent editors from uploading images with filenames containing whitespace or special charachters?

Hans Ravnsfjall
Hans Ravnsfjall
Reply

This was a setting in management center in DW8, and a really useful feature, but for some reason - it has been removed in DW9

I would really apprecieate this feature, as it would save us a lot of trouble and avoiding errors when images eg. are part of a json feed that is feeding eg. an IOS app, and stuff like that.

Is there a way to avoid users being able to upload files with these vicious filenames?

BR

Hans


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I still see the following in GlobalSettings on 9.3:

  <Modules>
    <Filemanager>
      <Upload>
        <Format>activex</Format>
        <FilesPrForm>5</FilesPrForm>
        <ReplaceSpace>True</ReplaceSpace>
        <LatinNormalize>True</LatinNormalize>
      </Upload>

Does that give you what you need?

 

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

That would be perfect :)

But it does not seem to work :/

I will report it to the Dynamicweb Support

 

Thanx for your help

 

 

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The upload functionality is no longer using those settings in DW9. File name replacements on upload didn't really solve all the problems, because files are uploaded in many different ways and often without going through that replace functionality.

As I see it, this problem is not really about the file names, but rather about how to properly encode values when used in certain contexts (URL paths, query strings, XML, JSON, etc.).
You can use methods like encodeURIComponent in js, encoding extensions for template tags or System.Net.WebUtility in C# code for encoding the file names.

If you do find examples where Dynamciweb renders broken or invalid URLs because of special characters in file names, then please let us know and we will take a closer look at that.


Best regards,
Morten

 

You must be logged in to post in the forum