Giter Club home page Giter Club logo

Comments (10)

sehmaschine avatar sehmaschine commented on July 29, 2024

check_file will be removed with the next version. however, we´re trying to solve that unicode issue with unicodedata.normalize("NFC", val) ... did that for another project and it seems to work. besides, I don´t think it´s a good idea to upload files with unicode-characters (you need to deal with possible downloads as well).

from django-filebrowser.

domenkozar avatar domenkozar commented on July 29, 2024

You should use unidecode library. As for "not uploading unicode chars", tell that to my clients :) Maybe there should be ascii validation at higher level to restrict that in this case.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

sorry, but what´s the "unidecode library"?

from django-filebrowser.

domenkozar avatar domenkozar commented on July 29, 2024

http://pypi.python.org/pypi/Unidecode/ - basically transliteration

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

thanks, didn´t know that one.

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

should be solved with the storage-branch. at least I´m not able to reproduce the error anymore. please reopen the ticket if the problem still exists for you (btw, the storage-branch will be merged with master today or tomorrow).

from django-filebrowser.

domenkozar avatar domenkozar commented on July 29, 2024

Any ETA for release?

from django-filebrowser.

sehmaschine avatar sehmaschine commented on July 29, 2024

since there haven't been any more issues lately, I'm going to release 3.4.0 within the next couple of days.

from django-filebrowser.

domenkozar avatar domenkozar commented on July 29, 2024

Awsome!

from django-filebrowser.

kurazu avatar kurazu commented on July 29, 2024

I'm experiencing this issue with django-filebrowser-3.4.0 when trying to upload the file "Amino skład.JPG". The issue only comes up on production, I can't reproduce it locally. Problem doesn't occur when there are no national characters in the filename.

Traceback (most recent call last):

File "XXX/django/core/handlers/base.py", line 111, in get_response

File "XXX/django/views/decorators/csrf.py", line 39, in wrapped_view

File "XXX/django/views/decorators/csrf.py", line 52, in wrapped_view

File "XXX/django-filebrowser-3.4.0/filebrowser/sites.py", line 502, in _upload_file
file_already_exists = self.storage.exists(file_name)

File "XXX/django/core/files/storage.py", line 218, in exists

File "/usr/local/python2.6/lib/python2.6/genericpath.py", line 18, in exists
st = os.stat(path)

UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142' in position 50: ordinal not in range(128)

<WSGIRequest
GET:<QueryDict: {u'csrf_name': [u'csrfmiddlewaretoken'], u'csrf_token': [u'NOTPROVIDED'], u'csrf_xname': [u'X-CSRFToken'], u'folder': [u''], u'qqfile': [u'Amino sk\u0142ad.JPG']}>,
POST:<QueryDict: {}>,
COOKIES:{'csrftoken': 'XXX',
'grappelli_show_documentstructure': 'on',
'sessionid': 'XXX'},
META:{'CONTENT_LENGTH': '78083',
'CONTENT_TYPE': 'application/octet-stream',
'DOCUMENT_ROOT': 'XXX/static',
'DOCUMENT_URI': '/admin/filebrowser/upload_file/',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-2,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'HTTP_ACCEPT_LANGUAGE': 'pl,en-us;q=0.7,en;q=0.3',
'HTTP_CACHE_CONTROL': 'no-cache',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_CONTENT_LENGTH': '78083',
'HTTP_CONTENT_TYPE': 'application/octet-stream',
'HTTP_COOKIE': 'csrftoken=XXX; grappelli_show_documentstructure=on; sessionid=XXX',
'HTTP_HOST': 'powerxsport.kurazu.megiteam.pl',
'HTTP_KEEP_ALIVE': '115',
'HTTP_PRAGMA': 'no-cache',
'HTTP_REFERER': 'http://powerxsport.kurazu.megiteam.pl/admin/filebrowser/upload/?type=image&pop=2',
'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28 ( .NET CLR 3.5.30729)',
'HTTP_X_FILE_NAME': 'Amino%20sk%C5%82ad.JPG',
'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
'PATH_INFO': u'/admin/filebrowser/upload_file/',
'QUERY_STRING': 'csrf_token=NOTPROVIDED&csrf_name=csrfmiddlewaretoken&csrf_xname=X-CSRFToken&folder=&qqfile=Amino+sk%C5%82ad.JPG',
'REMOTE_ADDR': 'XXX',
'REMOTE_PORT': '1667',
'REMOTE_USER': '',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/admin/filebrowser/upload_file/?csrf_token=NOTPROVIDED&csrf_name=csrfmiddlewaretoken&csrf_xname=X-CSRFToken&folder=&qqfile=Amino+sk%C5%82ad.JPG',
'SCRIPT_NAME': u'',
'SERVER_ADDR': 'XXX',
'SERVER_NAME': 'XXX',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SOFTWARE': 'nginx',
'wsgi.errors': <flup.server.fcgi_base.OutputStream object at 0xf454caec>,
'wsgi.input': <flup.server.fcgi_base.InputStream object at 0xf454ce4c>,
'wsgi.multiprocess': False,
'wsgi.multithread': True,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 0)}>

from django-filebrowser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.