hi, i have to work with files using zope, but i have some problem: i have one form in which you upload a file, then after the upload i have to parse (following instruction from the user) the file before inserting some of the data of it into a sql table. The problem comes when i have to pass the file from one form to another (this forms gives me instruction on how parse it) . I thought of some ways on how to deal with it but i don't know which one is better: - pass the file inside context/SESSION (but if the file is large and the connection is not good it could be slow) - create a temp file on to the filesystem (someone told me it coudl be dangerous and it's better not to use it) - create a temp file inside Zope (how? the module File seems not to have api that delete or truncate file isn't it ?) Also the same problem apply on to the download of a file that is like a csv (i found csvtool that handle this situation pretty well, however i'm curious on how to solve the problem with a any file) . Ah, i'd like to do everything without using dtml if possible. Any suggestion, code to look, web pages? Thanks Samuele
From: "Samuele Giovanni Tonon" <samu@sferacarta.com>
i have to work with files using zope, but i have some problem: i have one form in which you upload a file, then after the upload i have to parse (following instruction from the user) the file before inserting some of the data of it into a sql table. The problem comes when i have to pass the file from one form to another (this forms gives me instruction on how parse it) .
Can't you have a single form which gathers the instructions and the file name? Alternatively, gather the instructions first then send them to the form to get the file (easier to pass shorter fields around then the actual file) If you can't do either of the above I think you're going to have to use dtml/python scripts. Jonathan
participants (2)
-
Samuele Giovanni Tonon -
Small Business Services