Comments (10)
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.
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.
sorry, but what´s the "unidecode library"?
from django-filebrowser.
http://pypi.python.org/pypi/Unidecode/ - basically transliteration
from django-filebrowser.
thanks, didn´t know that one.
from django-filebrowser.
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.
Any ETA for release?
from django-filebrowser.
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.
Awsome!
from django-filebrowser.
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)
- Refused to connect HOT 8
- Frame loaded with http protocol HOT 4
- No clear settings HOT 4
- Select buttons disappear when Filebrowser called from CKEditor after upgrade HOT 1
- Issue with latest version
- 未来filebrowser是否考虑会添加webdev支持
- Add a `--force` flag to `python manage.py fb_version_generate`
- Should remove providing_args from the Signals
- ifequals is depreciated HOT 1
- FileBrowser is not compatible with Django 4? HOT 2
- FileBrowser permissions HOT 2
- override upload_to on save model method HOT 4
- Files with more than one extension (examples: .tar.gz, .tar.xz) are not permitted by _isAllowedExtension in filebrowser.js HOT 1
- Broken thumbnail with default settings HOT 1
- admin permission HOT 1
- doesnt work with pillow 10, please fix requirements.txt HOT 1
- Moving files between folders HOT 2
- Use absolute path for directory HOT 1
- Make Grappelli optional HOT 2
- Cannot translate the app name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-filebrowser.