View Full Version : Save each submission as an XML file?
tyman00
19-Apr-2007, 03:25 PM
I haven't seen any documentation or discussion on the Forum about creating a separate XML for each submission.
What we would like to be able to do is receive the submission and save it to a folder (either password protected or above the site root accessible only through FTP or an admin panel). Then we would download the XML file through a secure connection and import the file into our local software.
Is this a feature that has been thought about or are there any alternatives? Thanks!
russellr
19-Apr-2007, 08:52 PM
Hi,
No one has asked for XML, but CSV is support for this type of requirement.
One way would be to write your own filter program that has the side-effect of creating the XML file on the server.
In any case, we'll put it on the TO DO list to support XML natively in FormMail.
tyman00
19-Apr-2007, 09:32 PM
Thanks for the reply!
I knew CSV was supported, but I thought that all of the data was stored in one CSV file. Instead of one for each submission. I know it seems like a waste of storage space, but we need it to be separate for our software.
I was going to try the CSV route, but I figured that since XML is now becomming more and more the preffered flat file it was time for me to comply as well.
Thanks!
russellr
19-Apr-2007, 11:20 PM
Hi,
Yes, the CSV file concept is continually appending to the one CSV file.
Having said that, however, you could derive the "csvfile" field (using the %nextnum% feature, for example) and get a unique file name for each form submission.
This would give you the individual CSV file solution you want.
But, I agree, XML is a good way to proceed with a long term view.
tyman00
18-Jul-2007, 01:35 PM
Russell,
I am finally getting back to this. Too much going on around here :(.
I am just going to go with the CSV files right now. It should work. If XML was ever supported, then I would make the change to use XML instead of CSV.
I was thinking about using the %nextnum% feature. Could I also use %date% and %time%? That would make it more manageable. I know we run the slight chance that two people could submit the form at the exact same second. Possible... yes, likely... no. Maybe I could also include %nextnum% as well just to make sure the filenames are never the same. The number would be irrelevant except for the function of making each filename unique.
I don't think it is possible, but can I somehow derive the realname field into the filename?
Ex. DoeJohn-07182007-163401.CSV or RealName-DATE-TIME.CSV
russellr
18-Jul-2007, 08:41 PM
Hi,
Yes. Check out the HOW TO guides on Deriving fields and Uploading files.
There are examples shown of what you want.
tyman00
18-Jul-2007, 09:22 PM
Thanks, I actually got the idea about the Date/Time while looking through the HOW TO guides.
Another question I have is (maybe I missed it in the How To) will Formmail automatically create a new csv file if one doesn't exist?
russellr
18-Jul-2007, 10:44 PM
Hi,
This depends on whether the directory (CSVDIR) has write permission.
In general, we recommend that it doesn't, but for you application it will need to.
FormMail tries to create the file, and will only open it if it already exists.
Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.