Attachment Using Ajax Php Script

Posted : adminOn 9/10/2018
Attachment Using Ajax Php Script Average ratng: 3,6/5 2514votes

JavaScript is a client-side language. It is not concerned with (indeed, cannot) send e-mail, with or without an attachment. You'll need something server-side for that.

JavaScript can merely invoke the server-side script to send the e-mail, by requesting it, say, over AJAX, but it is not JavaScript which sends the e-mail. This is akin to people mistakenly writing things like 'I have some JavaScript which is getting some info from my database.' It is not - it is requesting a server-side script which is getting the info from the database. Hp Deskjet F2120 All-in-one Printer Driver For Windows Xp more.

My most recent attempt with jQuery to incorporate the file attachments looks like this: script type. Download Xerox Printer.

Thanks for immediate reply I checked the this row `$my_path = $_SERVER[‘DOCUMENT_ROOT’].”/your_path_here/”;` My directory structure is like this: `www. Com/ foldername/zipfilename.zip` When I try with static link it gives warnings: `Warning: filesize() [function.filesize]: stat failed for www. Com/foldername/zipfilename.zip on line 191 Warning: fopen(www. Com/foldername/zipfilename.zip) [function.fopen]: failed to open stream: No such file or directory Warning: fread(): supplied argument is not a valid stream resource Warning: fclose(): supplied argument is not a valid stream resource` Any idea? Sorry, I can’t say exactly how you need to do this in Windows:( (I use windows only to work in Adobe Photoshop) First you need to find a way to handle those paths in PHP on windows. I’m sure Google has a lot of information on that. On Linux I have one file (config.php) in the doc root, creating this constant variable: `define(‘DOC_ROOT’, dirname(__FILE__).’/’);` Next I include this file in my PHP scripts, let’s say the script is one level above the root I use `include_once ‘./config.php’` After including that file I’m able to use the variable DOC_ROOT in my scripts.

Php Ajax Post

This way the server variable DOCUMENT_ROOT is not needed anymore. I hope that helps.