[Zope] File upload Content type and File size

James van der Veen james@codenamefuture.nl
Mon, 4 Mar 2002 17:11:48 +0100


Hi everybody,
How woyld I be able to let a user upload a file and check the file size =
and
content type.

What I would like to do is check the filesize and content type of the =
file
before adding it to zope.
But It would be ok to get this info afterwards so I can immediatly =
delete
the file.

I use a form to upload the file.
Then process the info:

<dtml-call "manage_addFile( id=3Dnew_ArtNo, file=3Dnew_file, =
title=3Dnew_ArtNo
)">
this works fine.
What I thought I had to do next is:

<dtml-with new_ArtNo>
<dtml-var get_size>
</dtml-with>
(still in the same dtml-method)

but I don=B4t seem to get the property of the new created file but the =
folder
it is in and this raises an error.
I think it does this because if I say:

<dtml-with new_ArtNo>
<dtml-var title_or_id>
</dtml-with>

I get the title of the folder.

Can someone tell me how to get the right size of the newly added file.

Sure hope so!

Greetz,
Sjeems