Jump to content

atchua

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

atchua's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i'm currently writing 2 scripts... 1 is for extracting records from the database and writes it onto an excel file while the second will just be called after the first script finishes. it will then get the written excel file and send it through the mail() function in php to different recipients. the issue that i'm encountering is that sometimes the attachment that we receive is incomplete even though the actual file written is complete.  we are thinking of the following possibilities: a) the second script sends the file even though the first script has not yet finished writing the file or b) there is some certain limit on the size of the file attachment in the mail() function i have been encountering this problem for weeks and haven't figure out the reason as to why sometimes the attachment receive is incomplete or /cut short.  have also tried inserting some delay in between the scripts but the same thing is observed. thanks in advance
  2. i already have a script that can be divided into 2 parts: (a) retrieves records from the database then writes the retrieved records onto an excel file; (b) once the file has been created and populated with data, it will be sent as an attachment in an email with that scenario, i always receive an incomplete file.  In some forums, they say that the email sending process might have sent the email even before the file writing is not yet finished.  i have already inserted a delay between the two process/parts of 30 minutes but it produces the same thing. although without the delay of 30 minutes, the records lack around 70-90+ records while when the delay is inserted only around 10+ records is lacking in the attached file. i just want to ask why is this so? is there any other way to ensure that the file writing part is finished first before it can proceed to the code section where it sends out the email with the excel file created as an attachment. thanks
  3. just to clarify, and by the way thanks for the quick reply do i perform the str_replace("\n","\r\n", $data) before or after i perform the chunk_split() function? is it possible that php versions issues might cause the corruption as well? because when i run this script on my server, it works fine with complete and not corrupted file attachments.  But when i transfer the script to another server, the file attachment was corrupted.
  4. I got the following script from another site http://forums.devshed.com/php-development-5/help-php-mime-email-attachment-problems-112815.html: $headers .= "\r\nMIME-Version: 1.0\r\n" .             "Content-Type: multipart/mixed;\r\n" .                 " boundary=\"{$mime_boundary}\""; $email_message = "This is a multi-part message in MIME format.\r\n\r\n" .                 "--{$mime_boundary}\r\n" .                 "Content-Type:text/html; charset=\"iso-8859-1\"\r\n" .               "Content-Transfer-Encoding: 7bit\r\n\r\n"; $email_message .= "\r\n$email_txt \r\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\r\n" .                   "Content-Type: {$fileatt_type};\r\n" .                   " name=\"{$fileatt_name}\"\r\n" .                       //"Content-Disposition: attachment;\r\n" .                       //" filename=\"{$fileatt_name}\"\r\n" .                     "Content-Transfer-Encoding: base64\r\n\r\n" .                     $data . "\r\n\r\n" .                     "--{$mime_boundary}--\r\n"; // actual sending of the email $ok = @mail($email_to, $email_subject, $email_message, $headers); running it the first time had errors and i still have to include \r character for every \n in the header variable (as posted above).  after that, it had no problems sending the file/attachment.  however, upon checking the contents attachment, it was incomplete and cut short. i just want to ask if anyone experienced the same thing and what did you do to fix the problem of incomplete/corrupted file attachments. Thanks in advance
  5. i haven't found any descent documentation about ezPDF and if there are there were no details about special characters.  i already tried using nl2br() and addslashes() but neither works.  the first one makes the system also display the br tag while the latter has no effect to the string displayed meaning it has the same effect of text being overlapped to each other. any other ideas as to why this is so? cannot figure out what to do anymore thanks
  6. thanks, i'm already looking for a decent documentation on the ezpdf class
  7. still no luck, if \r\n is used the text overlaps but when \r alone is used it just writes/displays the text in one line. my guess is that the problem is already with the configuration or settings because the same scripts are used in different machines though not all display the desired appearance of the text on the PDF.  of course, i'm still new with the ezpdf functionality. any other ideas will be greatly appreciated  :)
  8. the classes that i used are class.ezpdf.php and class.pdf.php, wherein the class ezpdf extends the latter class.  both classes are version 9 and were downloaded from the net just to reiterate, the confusing part here is that why in some machines it work but in others it doesn't thanks for all the replies
  9. actually i am retrieving details from the database then i would store it on a variable let's say i would retrieve an id and name from the database and combine them into one string $string=id ."\n". name; after which i would use the string variable to write on the pdf using $pdf->ezText($string, 7); but after this process and when the pdf is streamed into php, the id and name overlap each other instead of the name placed on the next line on the pdf file created. i am running out of ideas because this same code when run in another server (with the same configuration and setup) actually works, meaning the id and name are separated and the newline character was applied.
  10. thanks for all the quick reply when i checked my php.ini file, the setup is already magic_quotes_gpc() = On magic_quotes_runtime() = Off magic_quotes_sybase() = Off i cannot figure out what is wrong anymore?
  11. i just tried itl but no change still both \r\n are ignored and when br tag is used or inserted, it is also displayed or written on the PDF file.  can this issue be resolved in php.ini file? thanks
  12. already tried it but the "br" tag is written on the pdf as well. i'm guessing that it is with the configuration of PHP in each of the machines but not sure what it is should be changed in the configuration file
  13. i am working on how to create PDFs through PHP by importing the ezpdf class.  the inserting of text in the PDF file works fine but the \n character is ignored thus making the text overlap each other.  However, in some machines it works out fine and the \n character is applied.  So i was just wondering if you are familiar with this problem? is this something to do with the configuration of the php (php.ini)? For example (coming from PHP): $pdf->ezText("hello\nagain", 12); the ideal display or output is: hello again but instead of displaying it, it ignores the \n character making the text overlap each other. hope someone could help me out with this, thanks in advance :)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.