Skip to content

Commit

Permalink
添加自定义上传模块
Browse files Browse the repository at this point in the history
  • Loading branch information
ddesign84 committed Jul 14, 2015
1 parent 6054776 commit dce48a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DjangoUeditor/views.py
@@ -1,4 +1,5 @@
#coding:utf-8
from importlib import import_module
from django.http import HttpResponse
import settings as USettings
import os
Expand Down Expand Up @@ -196,7 +197,12 @@ def UploadFile(request):
state=save_scrawl_file(request,os.path.join(OutputPath,OutputFile))
else:
#保存到文件中,如果保存错误,需要返回ERROR
state=save_upload_file(file,os.path.join(OutputPath,OutputFile))
upload_module_name = USettings.UEditorUploadSettings.get("upload_module", None)
if upload_module_name:
mod = import_module(upload_module_name)
state = mod.upload(file, os.path.join(OutputPath, OutputFile))
else:
state = save_upload_file(file, os.path.join(OutputPath, OutputFile))

#返回数据
return_info = {
Expand Down

0 comments on commit dce48a4

Please sign in to comment.