That makes sense, but that wasn't the issue I saw. This was a huge pdf
library, loaded into db myself from disk. When witango did the length
of the data retrieved from db, sometimes off, rare, but it happens.
Also, it would happen on the same pdf over and over, and none of the
others. When using binary length function from mysql, no issues. Or,
when populating the database with a LENGTH value, calculating from RB
on the way, no issue. The difference was usually 1 byte.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 9, 2008, at 9:38 AM, William M Conlon wrote:
This issue I experienced was that pdf files would not open in
windows. It turned out that the pdf downloaded to windows was one
byte longer than the pdf uploaded from MacOS9. When I did a side-by-
side comparison (pdfs are readable in a text editor even though
there are non-printing characters) there was an extra line
terminator (I forget which one).
Bill
William M. Conlon, P.E., Ph.D.
To the Point
2330 Bryant Street
Palo Alto, CA 94301
vox: 650.327.2175 (direct)
fax: 650.329.8335
mobile: 650.906.9929
e-mail: mailto:[EMAIL PROTECTED]
web: http://www.tothept.com
On May 8, 2008, at 11:56 PM, Robert Garcia wrote:
No, I did HOURS of testing on this. A PDF or a JPEG is binary as I
know you know. ;-) But witango looks at any var as TEXT with the
<@length tag. Just like in other languages, you can specify LEN and
LENB for byte length of TEXT or byte length of a binary field,
because it is not always the same. Most of the time it is, but it
occasionally is not.
I have found the best way is to store the data in a db, like mysql,
and then call it out, and use the mysql LenB function to get the
actual binary length.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 8, 2008, at 1:12 PM, William M Conlon wrote:
I think the problem is dependent on the means used to upload the
pdf -- an extra line terminator seemed to get included with
uploads from MacOS9.
I pass my pdfs through an upload filter to remove extra <@CR> and
<@LF> characters at the end of the file.
Bill
William M. Conlon, P.E., Ph.D.
To the Point
2330 Bryant Street
Palo Alto, CA 94301
vox: 650.327.2175 (direct)
fax: 650.329.8335
mobile: 650.906.9929
e-mail: mailto:[EMAIL PROTECTED]
web: http://www.tothept.com
On May 8, 2008, at 12:30 PM, Robert Garcia wrote:
Be mindful, that using <@length on the pdf data to get the
content-length works 99% of the time, but will be a byte or so
off 1% of the time or so, and will cause the client to not work
right. This is a issue with witango. Search the archives, you may
need to use an external method to accurately calc bytes, or use a
db to do so, etc.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 8, 2008, at 11:06 AM, Stefan Gonick wrote:
Hi Robert,
Thank you very much for this. You're a great help.
Stefan
At 01:02 AM 5/8/2008, you wrote:
All you have to do, is create a taf that reads in the DATA of
the pdf file, create your own custom header and serve the data
out. The custom header MUST have a correct content-length, or
it won't be compatible with all browsers. content-type should
be application/pdf, and THIS IS THE IMPORTANT PART, content-
disposition needs to be:
attachment; filename=thefilename.pdf
Substitute "thefilename.pdf" with the filename you wish. You
can also even do this with JPEGs or other image formats, and
the browser will not display, but instead download. I use this
technique in witango and php on several sights in production.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 7, 2008, at 7:38 AM, Stefan Gonick wrote:
Hi Everyone,
I need to create a link to a PDF file that immediately brings
up a download dialog
instead of opening the file. Does anyone know how to do this?
Thanks,
Stefan
=====================================================
Database WebWorks: Dynamic web sites through database
integration
http://www.DatabaseWebWorks.com
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
=====================================================
Database WebWorks: Dynamic web sites through database integration
http://www.DatabaseWebWorks.com
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf