1827887 Members
1587 Online
109969 Solutions
New Discussion

Re: MIME corruption

 
Roux Georges
Occasional Advisor

MIME corruption

Why MIME corrupts the pdf files?

Example:
Username: SYSTEM
Password:
Welcome to OpenVMS (TM) Alpha Operating System, Version V7.3-2
Last interactive login on Tuesday, 17-JAN-2006 07:58:04.52
Last non-interactive login on Tuesday, 17-JAN-2006 02:00:00.32
aXP
...

PASCAL>DIR PD:DOCUMENT1.PDF

Directory LABO:[LAREAL.INTERNET]

DOCUMENT1.PDF;1 17 6-JAN-2006 08:19:44.45

Total of 1 file, 17 blocks.


document1.pdf is a readable pdf file with Acrobat.


PASCAL>MIME

MIME>OPEN/DRAFT ZAZA.TXT

MIME>
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 7bit/8Bit ASCII
MIME> list
Message Headers:
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 7bit/8Bit ASCII
MIME> add PD:DOCUMENT1.PDF

MIME> save
%MIME-I-SAVEFILE, saving file . . .
LABO:[LAREAL.SOURCES]ZAZA.TXT
MIME> list
Message Headers:
Content-Type: multipart/mixed
Content-Transfer-Encoding: 7bit/8Bit ASCII
Attachment: 1
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 7bit/8Bit ASCII
Attachment: 2
Content-Type: application/pdf
Content-Disposition: attachment
Content-Transfer-Encoding: Base64

MIME> extract/attachment=2/FDL=sys$manager:pdf_file.fdl document3.pdf
%MIME-I-SAVEFILE, saving file . . .
DOCUMENT3.PDF

MIME> exit

PASCAL>dir document3.pdf

Directory LABO:[LAREAL.SOURCES]

DOCUMENT3.PDF;1 17 17-JAN-2006 13:41:03.60

Total of 1 file, 17 blocks.

document3.pdf is not readable with Acrobat

15 REPLIES 15
Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

Could you post the fdl too ?

Wim
Wim
Steven Schweda
Honored Contributor

Re: MIME corruption

Which MIME version?

MIME> show version

You run Acrobat on a VMS system? If not,
then you're omitting details which may be
important.
Roux Georges
Occasional Advisor

Re: MIME corruption

The version of MIME is V1.8

Acrobat is running on Windows.
The file examined is in a Pathworks diectory.


Here the PDF_FILE.FDL:

SYSTEM
SOURCE OpenVMS


RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT stream
SIZE 0

G. Roux
Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

I converted a PDF file with fixed record length to your fdl values. After that I get the file is dammaged when trying to load it in IE (via WASD).

I would try to do the extract without /fdl and check what kind of file you get (fixed I hope). And try it in IE (or whatever).

If that isn't working I would use a fixed record length fdl (512b).

Note : never used MIME.

Wim
Wim
Roux Georges
Occasional Advisor

Re: MIME corruption

After EXTRACT, I observe a difference on the longest record:

initial file:

DOCUMENT1.PDF;1 File ID: (1638877,2,0)
Size: 17/100 Owner: [LABO,GRA]

File attributes: Allocation: 100, Extend: 0, Global buffer count: 0
No version limit, Contiguous best try
Record format: Stream, maximum 0 bytes, longest 0 bytes
Record attributes: Carriage return carriage control
RMS attributes: None

Extracted file:

DOCUMENT3.PDF;2 File ID: (1638299,1,0)
Size: 17/100 Owner: [LABO,GRA]

File attributes: Allocation: 100, Extend: 0, Global buffer count: 0
No version limit
Record format: Stream, maximum 0 bytes, longest 578 bytes
Record attributes: Carriage return carriage control
RMS attributes: None


G. Roux
Steven Schweda
Honored Contributor

Re: MIME corruption

This may seem radical, but have you looked at
the files using a text editor (EDIT /TPU, for
example) to see if there are any visible
differences?
Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

Try set file /att=lrl=0.
Or try with a fixed length fdl.
Or dump the files to see the difference in contents.

Wim
Wim
Roux Georges
Occasional Advisor

Re: MIME corruption

The differences with EDIT/TPU are not clear.
But a DUMP is more significant.

Example on the block number 4 the deleted characters in a pdf stream.

line deleted character
000000 8D
0001A0 00


see attachment

G. Roux
Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

I would go for the fixed length fdl. No characters added/removed. Simply blocks of 512 bytes.

Wim
Wim
Roux Georges
Occasional Advisor

Re: MIME corruption

I don't understand

SET FILE/ATTRIB=(RFM:FIX,LRL:512) make the file not readable with Acrobat.

On an other side, if I introduce "FORMAT fixed" in the PDF_FILE.FDL
MIME refuse de conversion.


Example:

MIME> OPEN/DRAFT ZAZA.TXT
Message Headers:
Content-Type: multipart/mixed
Content-Transfer-Encoding: 7bit/8Bit ASCII
Attachment: 1
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 7bit/8Bit ASCII
Attachment: 2
Content-Type: application/pdf
Content-Disposition: attachment;
filename=BULGEN.PDF
Content-Transfer-Encoding: Base64
MIME> EXTRACT/ATTACHMENT=2/FDL=SYS$MANAGER:PDF_FILE.FDL BULEXT.PDF
%MIME-W-FDLCNVERR, error encountered during file conversion: status = 00B210A4
MIME>


G. Roux
Robert Atkinson
Respected Contributor

Re: MIME corruption

Roux, I had exactly the same problem - MIME corrupting my PDF files.

The files were coming over from Advanced Server as "Record format: Stream, maximum 0 bytes, longest 0 bytes"

I changed the A/S share file format to this to stop the problem :-

UK\\ALPHA> show share jetformjobs/ful

Shared resources on server "ALPHA":

Name Type Description
------------ --------- -------------------------------------------------------
JETFORMJOBS Directory
Path: SY2:[NET.INTERNAL.JETFORMJOBS.READY]
Connections: Current: 0, Maximum: No limit
RMS file format: Sequential Fixed
Directory Permissions: System: RWED, Owner: RWED, Group: RWED, World: RE
File Permissions: System: RWD, Owner: RWD, Group: RWD, World: R
Share Permissions:

Total of 1 share

UK\\ALPHA>


I was then able to do a '$ SET FILE /ATTRIB=(LRL:512, RFM:FIX)' on each file to fix the MIME problem. The file's were also readable in Adobe.

As your files have varying record lengths, I guess that's why you can't use the above command.

Rob.
Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

00B210A4 means error opening xxx as output.

Sure the fdl is correct ?

I modified my pdf to stream and tried to do the same. Didn't work (loaded blank in IE). My PDF must be different.

But : I had problems when using encoding base64 and tried /enc=7bit and without /fdl. I got a working pdf of format stream.

Also read "help add/enc".

Wim
Wim
John Abbott_2
Esteemed Contributor

Re: MIME corruption

There were some changes to MIME (V1.8) in VMS V7.3-2. Can anyone try this on a V7.3-1 system (mime V1.7) ?
Don't do what Donny Dont does
Roux Georges
Occasional Advisor

Re: MIME corruption

I have no experience on MIME 1.7.

With the fixed record format, it seems we are on the good way.

I resume, according to my last test:

- a pdf stream file attached by MIME and sent by MAIL is not Acrobat readable
(dammaged).

- the same pdf file transformed by the command

SET FILE/ATTRIB=(RFMP:FIX,LRL:512)

is not locally Acrobat readable (dammaged)

but attached by MIME and sent by MAIL the attachment is Acrobat readable.



G. Roux


Wim Van den Wyngaert
Honored Contributor

Re: MIME corruption

I found that some PDF's are stream_cr. These must be mime added with /ascii (generated on vms by eg txt2pdf).

I found fixed length PDF's and those must be mime added with /binary (downloaded).

Fwiw

Wim
Wim