473,811 Members | 2,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

decoding attachments

Hello,

I am working on a php script to archive emails from IMAP server. I can now
copy emails to a file or send to browser. What i am looking for is some
information on how to strip and decode attachments. is there is php
function?

I am not looking for a ready-made script. Just need a little insight into
how files are encoded and decoded through php.

Thanks in advance

p r e e t i


Jul 17 '05 #1
3 3194
"p r e e t i" <p.*********@p. h.p.w.o.r.l.d> wrote:
I am working on a php script to archive emails from IMAP server. I
can now copy emails to a file or send to browser. What i am looking
for is some information on how to strip and decode attachments. is
there is php function?

I am not looking for a ready-made script. Just need a little insight
into how files are encoded and decoded through php.


Email attachments are Base64 encoded. Look into base64_decode() :

http://uk.php.net/manual/en/function.base64-decode.php

HTH;
JOn
Jul 17 '05 #2
Check out the note I posted ages ago in the PHP manual entry for
imap_fetchbody:

http://www.php.net/manual/en/functio...-fetchbody.php

It's at the very bottom.

Uzytkownik "p r e e t i" <p.*********@p. h.p.w.o.r.l.d> napisal w wiadomosci
news:EvGQb.9437 $ZJ1.9351@laker ead01...
Hello,

I am working on a php script to archive emails from IMAP server. I can now copy emails to a file or send to browser. What i am looking for is some
information on how to strip and decode attachments. is there is php
function?

I am not looking for a ready-made script. Just need a little insight into
how files are encoded and decoded through php.

Thanks in advance

p r e e t i

Jul 17 '05 #3
Hey thanks Jon and Chung. I will go through it.

p.r.e.e.t.i

"p r e e t i" <p.*********@p. h.p.w.o.r.l.d> wrote in message
news:EvGQb.9437 $ZJ1.9351@laker ead01...
| Hello,
|
| I am working on a php script to archive emails from IMAP server. I can
now
| copy emails to a file or send to browser. What i am looking for is some
| information on how to strip and decode attachments. is there is php
| function?
|
| I am not looking for a ready-made script. Just need a little insight into
| how files are encoded and decoded through php.
|
| Thanks in advance
|
| p r e e t i
|
|
|
|
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3976
by: steve | last post by:
Hi, I am opening a stream that is UTF encoded. I use fgetc to read the stream- which is binary safe. I add every character read to a string. But when I look at the stream, I see some characters with a bunch of "?" question markets, and then utf8_decode has no effect on it either. How do you go about decoding utf. Does adding the characters to the
2
4251
by: Bjorn Jensen | last post by:
Hello! My resulting image har nearly same size of original (but not exact) and the nu.jpg can be shown, but it is modified so much, that it look totally different.... why? what to do? Greetings Bjorn! ============================ use strict; use Net::POP3;
27
15059
by: gRizwan | last post by:
Hello all, We have a problem on a webpage. That page is sent some email data in base64 format. what we need to do is, decode the base64 data back to original shape and extract attached image from it. Any help will be highly appriciated. Thanks
0
2768
by: Johann Blake | last post by:
In my need to decode a JPEG 2000 file, I discovered like many that there was no functionality for this in the .NET Framework. Instead of forking out a pile of cash to do this, I came up with the idea that costs nothing and it is inheritently built into the Framework. So here is the solution... When you use the WebRequest and WebResponse classes to obtain graphics from a web site, these classes have built-in decoding for JPEG 2000 files....
1
1711
by: Mad Scientist Jr | last post by:
I am writing a simple POP email reader in asp.net (vb.net) - I have the entire message read into a string variable. Can someone explain how to parse the message and save any MIME attachments out to file(s) so the user can download attachments to their local machine?
5
6369
by: Peter Jansson | last post by:
Hello group, The following code is an attempt to perform URL-decoding of URL-encoded string. Note that std::istringstream is used within the switch, within the loop. Three main issues have been raised about the code; 1. If characters after '%' do not represent hexademical number, then uninitialized value variable 'hexint' used - this is undefined behavior. 2. This code is very inefficient - to many mallocs/string
3
6909
by: olafmol | last post by:
Hello, i want to write a PHP4 script that reads POP3 or IMAP mail and can decode the possible attachments in the email. I've looked around for some classes to do this, and found a few, but most of them seem to be very lowlevel or lacking in functionality. Is there a good script, class or example for decoding email attachments? I have used a class called attachmentread, but this class expects an attachment as disposition: attachment,...
9
8821
by: KWSW | last post by:
Having settled the huffman encoding/decoding and channel modeling(thanks to the previous part on bitwise operation), the last part would be hamming encoding/decoding. Did some research as usual on hamming codes and how they work(well sort of) I got a general idea how to start constucting a (7,4) hamming code. Unfortunately I have no idea how to start on the decoding/error correcting part and some direction would be nice. --- for...
0
1833
by: Michele | last post by:
Hi there, I'm using a python script in conjunction with a JPype, to run java classes. So, here's the code: from jpype import * import os import random import math import sys
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10133
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.