Author |
Message
|
oware |
Posted: Mon Feb 11, 2002 9:18 am Post subject: |
|
|
Novice
Joined: 28 Jan 2002 Posts: 23
|
Hi,
I am trying to transfer .pdf file using binary read in VB and passing it over Queue. I am able to fetch the file contents from Queue and built the file on Mq series server. But when i open the file it gives message "The file is damaged and is repaired". I think there is some distortion while transfering file Over Queue. Can anyone tell what may be the problem.
Thanks in advance.
Rahul. |
|
Back to top |
|
 |
kolban |
Posted: Mon Feb 11, 2002 9:40 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Is the file size the same when re-written to the disk from the queue by your application? You might also set the Format field of the MQMD to MQFMT_NONE when sending. If it has been set to MQFMT_STRING, it may have been character converted. |
|
Back to top |
|
 |
oware |
Posted: Tue Feb 12, 2002 3:09 pm Post subject: |
|
|
Novice
Joined: 28 Jan 2002 Posts: 23
|
Hi,
Yes the filesize is same. It shows the correct size while writing to the disc.But then image or file is distorted. I tried using API calls and its working fine. But when i use activex, its give me this problem.
Would appreciate if u can throw some light onit.
Thanks.
Rahul. |
|
Back to top |
|
 |
oz1ccg |
Posted: Wed Feb 13, 2002 12:21 am Post subject: |
|
|
 Yatiri
Joined: 10 Feb 2002 Posts: 628 Location: Denmark
|
are you shure that all the records are in the correct order ?
Normally it's up to the application to ensure that, MQSeries don't gurantee that the records are delivered in correct order.
_________________ Regards, Jørgen
Home of BlockIP2, the last free MQ Security exit ver. 3.00
Cert. on WMQ, WBIMB, SWIFT. |
|
Back to top |
|
 |
oware |
Posted: Wed Feb 13, 2002 7:33 am Post subject: |
|
|
Novice
Joined: 28 Jan 2002 Posts: 23
|
Hi,
My application reads a binary file into a variable which is send onto the Queue as a single message. But i am able to see only part of the file for example when i pass a .pdf file. This is done in VB application using Activex.
Thanks in advance.
Rahul.
|
|
Back to top |
|
 |
oware |
Posted: Wed Feb 13, 2002 7:48 am Post subject: |
|
|
Novice
Joined: 28 Jan 2002 Posts: 23
|
This is the code to read a binary file and send it over to Queue.
Set MQSess = New MQSession
Set QMgr = MQSess.AccessQueueManager("queue.manager.1")
Set Queue = QMgr.AccessQueue("QUEUE2", _
MQOO_OUTPUT + MQOO_FAIL_IF_QUIESCING, "queue.manager.1")
'Putting Message on server Queue manager
Set PutMsg = MQSess.AccessMessage()
PutMsg.Format = MQFMT_NONE
Open filenamebuffer For Binary As #1 ' source
Dim readbufferlen As Long, readbuffer As String
readbufferlen = LOF(1)
readbuffer = Space(readbufferlen)
Get #1, , readbuffer
PutMsg.MessageData = readbuffer
Set PutOptions = MQSess.AccessPutMessageOptions()
PutOptions.Options = MQPMO_SYNCPOINT
Queue.Put PutMsg, PutOptions
is it correct or am i missing anything that is causing this problem.
Thanks.
Rahul. |
|
Back to top |
|
 |
|