Paul Crabtree wrote:

Hi, i've been using Cocoon 2.1 for a few months now but i've only just
joined this mailing list so i apologise if this sort of question has
been and gone.

Here's what im trying to do:

"Provide a form for users to upload their CSV files. When the user
uploads the CSV file Cocoon takes the file and passes it to the text
generator and through the chaperon transformers to do a similar thing to
what the chaperon CSV sample does now."

I dont think i need to save the file at all but i cant work out how to
pass it to the text generator, XSP?

Is this possible?

Read the wiki for file-upload handling. If auto-save uploads is set to true, you should be able to use the name of the upload field (using input module {request-param:name_of_field}) in the src attribute of the text generator (we have this? isn't it a Chaperon generator? sorry for my ignorance). This would be relying on the toString implementation of PartOnDisk, which I think will give you the file location. You may need to use src="file://{request-param:name_of_field}".


Alternatively, you could also use an action or flow to get the filename in a form that would work (and even save it somewhere permanent) and pass it to the pipeline as a sitemap param (in the case of action) or some other form (request attribute??) for use in your src.

These feel kind of hacky and it would be better to create a source handler for uploads. This probably would be pretty simple if you want to pursue it. I think I hinted at this with someone else recently. I don't have time to invest in it now, but could help you or someone else through it.

Geoff


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to