How to setup for jQuery
I am new on Javascript. However I want to implement the jquery plugin for File uploading.
Here is the setup guide I found but I have no basic knowledge on how to setup this.
I am using python (flask) as my server side implementation
From the setup guide heading,
Using jQuery File Upload (UI version) with a custom server-side upload handler
I have no idea on how to setup point 1, 4, 5
for 1, what is a upload handler? and how to implement in python (flask)?
for 4, what doses "Upload the jQuery-File-Upload folder to your website."??? what is it use for?
and for 5, I have to return a JSON response on the upload handler? Why we have to do that?
The setup is quite complicated...anyone can give me some hints?
Kit
Maybe one or two hints:
The upload handler is simply a URL endpoint that the jQuery File Upload can send files to - it needs to be able to handle incoming HTTP requests.
@app.route("/uploads", methods=["GET", "POST"])
def upload_handler():
# Handle the upload here
pass
You don't need to upload the entire folder - only the CSS and JavaScript you will be using. If you only need file uploading your template could look like the basic setup. (However, you should minify and concatenate your files for a deployed website).
You return a JSON response to the upload handler so that the script handler performing the XHR file upload request can know things like:
The linked example for Flask seems very similar to the Django example for the new version - you can probably start with that and then patch it to work with the new version of jQuery file upload.
链接地址: http://www.djcxy.com/p/58406.html上一篇: 将WindowState设置为最大化会导致窗口显示得太早
下一篇: 如何设置jQuery