Andréas Kalogéropoulos wrote:
> You seem to omit the mime/type in your method.
> UploadedFile has one, but in case it is "application/octet-stream", it
> should try to sniff it using NXMimeTypes, no?

yep but...

... keep in mind that the mimetype sniff from stream is limited to
jmimemagic  available filters at the moment (which means not a lot).
Give the extension, when you can, to be sure to get a consistent result.
For instance, within NXFileManager you should extract the extension from
the path for the UploadedFile  and give it as a parameter while asking
for the mimetype (see NXMimetypeRegistry API)

[...}

        J.

>> Hi all,
>>
>> Now the FileBlob is serializable so you can use it for large blobs
>> instead of using ByteArrayBlob
>> The recommended way to create blobs from an uploaded file is to use the
>> method
>>
>> FileManagerUtils.createSerializableBlob(UploadedFile)
>>
>> This method is creating a FileBlob (that stores data on a temp file on
>> hdd) if the uploaded  data is larger than 64K otherwise it creates a
>> ByteArrayBlob to store it in memory.
>>
>> Bogdan
>> _______________________________________________
>> ECM mailing list
>> [email protected]
>> http://lists.nuxeo.com/mailman/listinfo/ecm
>>
>>
> 
> 
> 
> This e-mail and any attachment is for authorised use by the intended 
> recipient(s) only. It may contain proprietary material, confidential 
> information and/or be subject to legal privilege. It should not be copied, 
> disclosed to, retained or used by, any other party. If you are not an 
> intended recipient then please promptly delete this e-mail and any attachment 
> and all copies and inform the sender. Thank you.
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm
> 


-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - http://www.nuxeo.com
Nuxeo 5 : http://www.nuxeo.org
Mobile: +33 (0) 6 72 57 57 66

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to