Javascript file generation to php solution

Source: Internet
Author: User
The javascript generated file is sent to php. This post was last edited by barry963 from 2013-10-1405: 06: 46. Hello, I am working on a website, this website can be automatically generated and downloaded by jquery. The function is to use php to send an email as an attachment to the generated excel file. Therefore, javascript generates a file and transmits it to php.
This post was edited by barry963 at 05:06:46 on. I am working on a website where jquery can automatically generate and download excel files. The function is to use php to send an email as an attachment to the generated excel file. Therefore, the first step is to automatically pass the generated excel file to php. So is there any way for you.

The code for generating an excel file is as follows:


$ (Document). ready (function (){
$ ("# ExcelExport"). click (function (){

Var fileexample; // File declaration

... // Generate a file

Fileexample. click (); // download the object

Return fileexample;
});
});


I have tried some methods and listed them. it may be helpful:
1. the fileexample file in the code, that is, the generated file, is directly sent to php through the POST request of jquery ajax. However, common variables such as strings can be passed.
2. pass the original data of the generated file to php. the file is generated by php, but you do not know how to do it.

Thank you for your help in advance. For the first time I came into contact with such projects, please forgive me for any illustrations. Javascript php jquery? Share with ajax:
------ Solution --------------------
Pass data to php for php to generate files and send emails

Please refer to PHPExcel class library

Https://github.com/PHPOffice/PHPExcel
------ Solution --------------------
The browser's security settings require that the browser Upload files only when the user clicks.
To automatically upload data, you must submit the data directly instead of files.

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.