Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JSP connector] File upload error in a folder with exotic characters #40

Closed
jorgeoa opened this issue Nov 18, 2010 · 8 comments
Closed

Comments

@jorgeoa
Copy link

jorgeoa commented Nov 18, 2010

I'm getting an error when try to upload a file into a folder that has exotic chars in its name (España for example).

The POST request to the server returns this text:

<textarea>{}</textarea>

and the interface shows a "undefined" message.

The addfolder method works fine, you can create a folder inside another with exotic chars.

up to now I can't found a solution or workaround, but I'm working on it

@simogeo
Copy link
Owner

simogeo commented Nov 18, 2010

with both PHP and JSP connector?

@jorgeoa
Copy link
Author

jorgeoa commented Nov 18, 2010

I think PHP connector works fine.

I haven't time now to test the PHP connector, so I'll try it later.

@simogeo
Copy link
Owner

simogeo commented Nov 18, 2010

I'll do it, don't worry. Thanks for the bug report

@jorgeoa
Copy link
Author

jorgeoa commented Nov 18, 2010

I found a workaround by converting from ISO-8859-1 to UTF-8 the currentpath parameter.

In function add, line 334 in FileManager.java, I'm using this code:

else if (item.getFieldName().equals("currentpath")){
currentPath = item.getString();
currentPath = new String (currentPath.getBytes("ISO-8859-1"),"UTF-8");
}

@trickydicky
Copy link
Collaborator

This has been solved by using the function cleanString also for the creation of directories. That means that exotic characters are not allowed in a directory name. This may seem ugly, but the file manager in for instance Joomla does the same thing.

By the way, the error does occur also in the php connector

@simogeo
Copy link
Owner

simogeo commented Nov 21, 2010

trickydicky > works fine for php.
But I think we should have a unique policy regarding folder names. I will probably apply the cleanString methode as well

@jorgeoa
Copy link
Author

jorgeoa commented Nov 22, 2010

Hi.

cleanString solves the problem in the upload proccess, but if the server contains folders or files with exotic chars, the problen is already there.

If I want to use this file manager in a existing webpage, and I have somo exotic characters in folders or files (this could be usual in languages like Spanish or French), I'll have a lot of problem with it.

I think that the clearString function in the right way, but I algo think that the filemanager should can deal with those cases. The 'new String (currentPath.getBytes("ISO-8859-1"),"UTF-8")' can solve it easily.

Also, I would like to propose that the cleanString will be more "exotic character friendly", I mean:

  • Replace "ñ" with "n"
  • Replace accented vowels with standard vowels: "áà" => "a"; "éè" => "e", etc.
  • Replace "ç" with "c"

And maybe, space with underscore? For readability...

Regards.

@simogeo
Copy link
Owner

simogeo commented Dec 16, 2010

This is done now for PHP connector. Should be applied to other connectors.

PHP conn : cleanString() is now called on addfolder() method

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants