Page 1 of 1

get wav-file out of mail...

Posted: Wed Dec 09, 2009 10:27 pm
by aerypton
I have some e-mail with a wav-file as attachment.
I cutted out the the encoded attachment. you'll see it hereunder.

This is the code I used for decoding and saving the attachment.

Code: Select all

put base64Decode(tAttament) into URL ("file:attachment.wav")

The result is a lot of noice, but not the initial wave-file...
Can anyone help me?

This is the attachment: http://www.aerypton.be/attachment.txt
This is the whole mail: http://www.aerypton.be/wholemail.txt

Re: get wav-file out of mail...

Posted: Thu Dec 10, 2009 12:28 am
by bn
aerypton,
I tried your mime attachement and copied just the encoded part from the whole mail into a field in rev. then I used this code

Code: Select all

on mouseUp
   put field 1 into myData
   put specialfolderpath(desktop) & "/" & field "fDest" into myDest
   put base64Decode(myData) into URL ("binfile:" & myDest)
end mouseUp
and it worked.
I dont know how you access the data, is it from a text file from the email? I again saved just the data from your email to a text file and imported it and then exported it decoded with this code

Code: Select all

on mouseUp
   put specialfolderpath(desktop) into myPath
   put myPath & "/" & field "fsource" into myPath
   put url ("binfile:"& myPath) into myData
   put specialfolderpath(desktop) & "/" & field "fDest" into myDest
   put base64Decode(myData) into URL ("binfile:" & myDest)
end mouseUp
Field "fSource" is just the name of the textfile I saved the data in and field "fDest" is the name of the wav file "024006657-0032476265319-1222768476.160.WAV"
BTW when I tried your post with just the code in it it did not work, it had lost its line delimiters which seem to be important for base64.
I think it is important to save it as binfile as in ("binfile:" & myDest) otherwise Rev changes the line delimiter appropriate to the platform you are saving to.
If it does not work for you you might describe a little more in detail how you go about it and post some code.
regards
Bernd
PS from what I gather this is a tech support phone call with problems on the main-pagina with the button. :) Unfortunately I could not help.

Re: get wav-file out of mail...

Posted: Thu Dec 10, 2009 12:32 am
by aerypton
Yes!!!! Thank you very much...
binfile... that make it work!