Hello,
I tried to follow this instruction to send a report via e-mail. The Mail will be sent out but
without attachment of the report. The report is created properly and available in the temp dir.
In the same procedure I'd like to store the file with a new name in a local folder - unfortunately I get following error message and I couldn't find any reason for it.
Here's the value of both variables containing the filenames:
Code: Select all
$file = C:\wamp64\www\bts-sandbox1/temp/nupdf_60b266a01e75190.pdf
$file_new = Z:\temp\Angebot-Nr-1012.pdf
This is the procedure (sendemail):
Code: Select all
$file = "#filename#"; // get Filename
$angebot = "#auf_nummer#"; // get Order Number
$file_new = $file_new . '\Angebot-Nr-' . $angebot . '.pdf'; // prepare new filename
nuSendEmail('xxxxx@web.com','xxxxxxxx@gmail.com','From','Content','Subject', [$file], true); // Send E-Mail to xxxx@gmail.com
// Get folder to save new the file
$sql = 'SELECT inp_dir_angebote FROM systemsettings LIMIT 1';
$result = nuRunQuery($sql);
if (db_num_rows($result) > 0){
while($row = db_fetch_row($result)){ // Get Folder from systemsettings table
$dir_angebot = $row[0];
}
}else{
$dir_angebot = 'c:'; // no folder defined
}
$file_new = $dir_angebot . $file_new; // Folder + Filename
nuDebug($file);
nuDebug($file_new);
copy($file, $file_new); // Copy Report
This is the error message when I try to copy the report :
Code: Select all
Call Stack
# Time Memory Function Location
1 0.0004 448576 {main}( ) ...\nuapi.php:0
2 0.0195 696032 nuRunPHPHidden( ) ...\nuapi.php:67
3 0.0260 1538928 nuEval( ) ...\nucommon.php:421
4 0.0268 1548424 eval( '$file = "C:\\wamp64\\www\\bts-sandbox1/temp/nupdf_60b264b8592bbc4.pdf"; // get Filename
Can someone help me in this regard please?
Thanks a lot.
Oli!