Topic: gmail attachementu saugojimas

sveiki,
radau pavyzdžius kaip daryti, bet gaunu .csv failo encoding - 6 ir nesuprantu kaip jį sutvarkyti, kad žmonių kalbą rodytų :)

[1] => Array
        (
            [is_attachment] => 1
            [filename] => 20150115.csv
            [name] => 20150115.csv
            [attachment] => begin 660 20150115.csv
M3.1H971Y<W1U;FYI<W1E.U1O:6YE;B!LY&AE='ES='5N;FES=&4[37EY;G1I
M=&EL875S;G5M97)O.TUA:W-A:F%N('-O<&EM=7-T=6YN=7,[4&%L=F5L=3M(
M879A:6YT;R!P=FT[26YF;VMO;V1I.U!A:6YO.U1I;&%V=75S.U-Y=GEY<SM,
M979E>7,[2V]R:V5U<SM,Y&AE='3D:N1N(&YI;6DQ.TSD:&5T=.1JY&X@;FEM
M:3([3.1H971TY&KD;B!O<V]I=&4Q.TSD:&5T=.1JY&X@;W-O:71E,CM,Y&AE
M='3D:N1N(&]S;VET93,[3.1H971TY&KD;B!P;W-T:71M<#M,Y&AE='3D:N1N
M('!O<W1I;G)O.TSD:&5T=.1JY&X@;6%A:V]O9&D[5F%S=&%A;F]T=&%J86X@
M;FEM:3$[5F%S=&%A;F]T=&%J86X@;FEM:3([5F%S=&%A;F]T=&%J86X@;W-O
M:71E,3M687-T86%N;W1T86IA;B!O<V]I=&4R.U9A<W1A86YO='1A:F%N(&]S
M;VET93,[5F%S=&%A;F]T=&%J86X@<&]S=&ET;7`[5F%S=&%A;F]T=&%J86X@
M<&]S=&EN<F\[5F%S=&%A;F]T=&%J86X@;6%A:V]O9&D[5&EL83M!:6MA.U!A
M:6MK83M,=6]V=71U<V%I:V$[4&%I:VMA.TMU:71T86%J83L*2D9)-C,S,CDP
M,#`P,#`T.34P,C<[(#L@.S8S,S(Y,#M)=&5L;&$@16-O;F]M>2`Q-CLQ,BXP
M,2XR,#$U.R`[+#8[,3$L-#LL,S8[+#(R.RPQ-#4[5D522U1%4B!354]-22!/
M63L@.U!,(#8S,#`[(#L@.TA%3%-)3DM).S`P,#`R.T9).U=(15-,64X@1U)/

gal kas susidūrėt su tokiu variantu, ar bent galit pasakyti koks čia kodavimas?

Re: gmail attachementu saugojimas

radau! Content-Transfer-Encoding: uuencode
gal galit pasakyti kaip tą valgyti? :)


Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

3 (edited by aivaras37 2015-01-15 16:12:39)

Re: gmail attachementu saugojimas

Greičiau problemos sprendžiasi kai pats neri į jas ir ieškai info iš to ką žinai.
Ačiū, sužinojau apie uuencode, tuo tarpu tau atsakymas: http://php.net/manual/en/function.convert-uudecode.php

Re: gmail attachementu saugojimas

Aivarai, ačiū už atsakymą, tačiau tas decode'as nieko doro nepadaro. Jau radau, kad man siunčia tokius emeilus iš *nix'ų bash'o.
Komanda:

 uuencode attach.txt attach..csv | mail -s "My Subject" me@somewhere.com

kaip man tokį reikalą pasidaryti vėl csv? Jeigu downloadini per gmailą į pc normaliai su exceliu atsidaro. Kur problema?


Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: gmail attachementu saugojimas

kostmosas.. http://www.silisoftware.com/tools/uudecode.php decodina tą patį mano stringą ir siūlo downloadintis x.dat failą, kuriame yra visas csv contentas. Man lokaliai nieko nepavyksta :/


Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: gmail attachementu saugojimas

Ar čia pilnus duomenis pastinai?

vim zz
paste tavo duoti duomenys.

tmp $ uudecode zz
uudecode: zz: 20150115.csv: short file

žiūrint čia http://www.linuxmisc.com/10-unix-questi … 2ec658.htm panašu, kad turinys nepilnas.

Re: gmail attachementu saugojimas

taip, galiu asmenine žinute tuoj atsiųsiu

Re: gmail attachementu saugojimas

Taigi, ačiū už pagalbą Aivarui, finišas:

if($attachments[$i]['is_attachment']) 
                {
                    $attachments[$i]['attachment'] = imap_fetchbody($inbox, $email_number, $i+1);

                    /* 4 = QUOTED-PRINTABLE encoding */                    
                    if($structure->parts[$i]->encoding == 3) 
                    { 
                        $attachments[$i]['attachment'] = base64_decode($attachments[$i]['attachment']);
                    }
                    /* 3 = BASE64 encoding */
                    elseif($structure->parts[$i]->encoding == 4) 
                    {
                        $attachments[$i]['attachment'] = quoted_printable_decode($attachments[$i]['attachment']);
                    }
                    /* 6 = UUENCODE encoding */                    
                    elseif($structure->parts[$i]->encoding == 6) 
                    {
                        $myFile = "1.csv";
                        file_put_contents($myFile, "");
                            $fileData = explode("\n", $attachments[$i]['attachment']);
                                foreach($fileData as $line) {
                                    $b = convert_uudecode($line);
                                    file_put_contents($myFile, $b, FILE_APPEND);
                                }
                    }    
                }