Uploading files in PHP problem: An upload file button a save button

Source: Internet
Author: User
Keywords Php

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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.