[development] Files on previews

Ber Kessels ber at webschuur.com
Fri Nov 11 00:12:12 UTC 2005


Hello all files people.

I am getting somewhere with my files stuff, but i'd like some gurus and/or
original file.inc developers to comment on an issue:

We have a lot of code in upload.module and some in file.inc to cater
previews. In case of a preview, we try to serve the files from the temp
folder, or we try to generate temporary URLS etc (since we have no nid
yet!)
This is a bit crufty IMHO. I want to change this, in my code to behave as
follows:

* A node (or comment or whatever) that has attachements that are valid are
inserted into the files system all the way. we only leave the obid (the
column in tghe files dir for object ids like nid) empty
* invalid files are deleted immediately
* Once the object is inserted and saved, we have an obid (nid, mostly) and
we update the table.

That way, on loads of previews, we should be able to just use the urls,
apis and functions we use normally.

So:
Why did we choose for the current method of writing all the exceptions for
previews? Did I miss something important that renders my idea impossible?
Should I take care of something else?

Ber

-- 




More information about the development mailing list