[Zope] Re: File Upload via form (with other form variable) and storing it in a database

Peter Sabaini sabaini@inode.at
Mon, 03 Mar 2003 09:36:02 +0100


This is a cryptographically signed message in MIME format.

--------------ms030608010601080801010801
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Maik Jablonski wrote:
> Edward Muller wrote:
> 
>> Okay... Saw that
>> But it doesn't tell me how to get the file into a postgres database
>> though.
> 
> 
> Take the content of the file and store it with an ExternalMethod
>  in a BLOB-field... btw: I don't think that Postgres is a good storage 
> for binary-objects...

[snip]

Why so? Do you have negative experience with BLOBs in Postgresql? I did 
some (very unscientific) tests with some mp3s once, and it seemed to 
perform quite well.  This was with Postgresql 7.2, and about 500Mb of data.

  - peter.

--------------ms030608010601080801010801
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJcjCC
AxcwggKAoAMCAQICAwlZhTANBgkqhkiG9w0BAQQFADCBkjELMAkGA1UEBhMCWkExFTATBgNV
BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMQ8wDQYDVQQKEwZUaGF3dGUx
HTAbBgNVBAsTFENlcnRpZmljYXRlIFNlcnZpY2VzMSgwJgYDVQQDEx9QZXJzb25hbCBGcmVl
bWFpbCBSU0EgMjAwMC44LjMwMB4XDTAzMDIyMTEzMTY0NloXDTA0MDIyMTEzMTY0NlowWzEQ
MA4GA1UEBBMHU2FiYWluaTEOMAwGA1UEKhMFUGV0ZXIxFjAUBgNVBAMTDVBldGVyIFNhYmFp
bmkxHzAdBgkqhkiG9w0BCQEWEHNhYmFpbmlAaW5vZGUuYXQwggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQC1XhEfxugiGePyj2dxvgshFABfJw+Zcfar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