Thursday, 15 July 2010

subclass - changing UPLOAD_DIR for django-ajax-uploader -


Newbie here, Sir, I manage to set up DJJO-AJAX-uploads for my study project study. And use it initial view, URL, and templates to see how it works. I successfully uploaded a file to 'Default' on a default directory.

Now, I am trying to change UPLOAD_DIR used by something like 'endorsement' folder.

Regarding the DJENGOGO- AJAX-upload: UPLOAD_DIR is located in the local local local block area backend. Class Local UIPLoadback (AbstraSupback Backend): UPLOAD_DIR = "Upload" DIF Setup (auto, file name, * AGR, etc.): ** Quarj): Self. _path = os.path.join (settings.MEDIA_ROOT, self.UPLOAD_DIR, filename) Try: OS. Excluding Makedirs (os.path.realpath (os.path.dirname (self._path))): manually ._dest = BufferedWriter (FileIO (self._path, "w"))

Ajax is calling import_uploader = AjaxFileUploader () to upload an action file. Where in the AjaxFileUploader it is the __init __

  class is the AjaxFileUploader object: def __init__ (self, backend = none, ** kwargs): if there is no backend : Backend = LocalUploadBackend Self.get_backend = lambda: backend (** kwargs)   

I'm not sure that this is the correct way to change UPLOAD_DIR via subclass. Here's my code. AJAXuploader.views import from AjaxFileUploader from AJAXuploader.backends.local Import LocalUploadBackend class myajaxfileuploader (AjaxFileUploader): def __init __ (auto, backend = none, ** kwargs): Local = LocalUploadBackend.UPLOAD_DIR local = "endorsement" super (myajaxfileuploader, Self) .__ init __ (backend = local, ** kwargs)

I can see file upload file button but one upload fails me What is the right way to do this?

* Problems to read this project - fixes in the gyx-upload github issue section There

I change my initial import_uploader = AjaxFileUploader () to import_uploader = AjaxFileUploader (UPLOAD_DIR). = 'Endorment')

django-ajax-upload Support for changing this argument to ..grr ...

No comments:

Post a Comment