Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. question on php imap_open, base64_decode and csv file attachments

question on php imap_open, base64_decode and csv file attachments

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
questionphpcomtoolsjson
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cjoki
    wrote on last edited by
    #1

    Hello, I have a small project to make a script to check an email account, for an email from a specific source and then check that email for a file attachment. This file is a csv file. Using php's imap functions I cna login in find the correct email. When I go to parse the attachment (if one is found) I can print_r the contents and get readable content using the base64_decode. I have also noticed these 3 characters at the front of the file

    

    If i was to take a guess, these are the from the header section of the file. the rest of the file displays properly with the first line containg the column headers in quotes and seperate by commas. The following lines are fine. I have based my scripts function based on this article. http://www.electrictoolbox.com/extract-attachments-email-php-imap/[^] and can not find mention of these characters... and ideas?

    G 1 Reply Last reply
    0
    • C cjoki

      Hello, I have a small project to make a script to check an email account, for an email from a specific source and then check that email for a file attachment. This file is a csv file. Using php's imap functions I cna login in find the correct email. When I go to parse the attachment (if one is found) I can print_r the contents and get readable content using the base64_decode. I have also noticed these 3 characters at the front of the file

      

      If i was to take a guess, these are the from the header section of the file. the rest of the file displays properly with the first line containg the column headers in quotes and seperate by commas. The following lines are fine. I have based my scripts function based on this article. http://www.electrictoolbox.com/extract-attachments-email-php-imap/[^] and can not find mention of these characters... and ideas?

      G Offline
      G Offline
      Graham Breach
      wrote on last edited by
      #2

      Those three characters are a byte order mark[^]

      C 1 Reply Last reply
      0
      • G Graham Breach

        Those three characters are a byte order mark[^]

        C Offline
        C Offline
        cjoki
        wrote on last edited by
        #3

        Graham, Thanks for the info. I will be sure to strip it out as I process these files. All the best!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups