A browse (that is, select the file, but do not upload)
A save (click this before uploading).
How do you write this business logic? Because after the selection of files are automatically uploaded Ah, save the button is chicken
Reply content:
A browse (that is, select the file, but do not upload)
A save (click this before uploading).
How do you write this business logic? Because after the selection of files are automatically uploaded Ah, save the button is chicken
Can be configured with the plug-in.
Write your own words, select the pictures do not let him request interface
Picture preview, this is mainly in the front-end to do, click Save, in the content submitted to the server, the specific implementation can refer to the following
Https://github.com/zp1996/myUpload/blob/master/upload.js
Forget the statement.
With the jquery uploadify plugin, he has an upload successful callback address parameter uploadsuccess.
I was thinking about how to deal with it more safely.
Add:
I was thinking that the user has uploaded the image, but the path has not been stored in the database, and then the user changed the picture.
In this case, can I only write a shell script to delete the image under the upload directory periodically?
Browse to select a picture, actually uploaded to the server, the return of the server address exists in the hidden form, click on Submit the picture with the user binding
It's just that this piece is involved in the project.
Preview the words directly at the front can be solved
$(上传文件Input).change(function(){ var file = this.files[0]; var r = new FileReader(); r.readAsDataURL(file); $(r).load(function(){ //关键在 this.result $(selector).html('').css('background','url('+this.result+')'); }) });
After completing the preview function, I am using AJAX to complete the image upload function