instead of using cStringIO, use a file object, and save the backup to the
hard disk. Then have a list of available timestamped backups, and stream the
file for download.

Though as discussed below, csv backup usually is not the best solution.

http://groups.google.com/group/web2py/browse_thread/thread/693835bb53c081b4/325dc6dc6f03086e?lnk=gst&q=on+backup#325dc6dc6f03086e



-Thadeus




On Mon, Dec 21, 2009 at 9:44 AM, vvk <varunk.ap...@gmail.com> wrote:

> I take backups regularly, at say time1, time2, time3.
> If I provide this function:
> def myaction():
>     import cStringIO
>     file = cStringIO.StringIO()
>     db(...).select().export_to_csv_file(file)
>     return file.getvalue()
> I'll be able to download DB at current state, not of previous times. I
> want to download csv files having old databases.
>
>
>
>
> On Dec 21, 8:05 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > Please tell us more. I am not sure I understand what you want to do.
> >
> > On Dec 21, 8:45 am, vvk <varunk.ap...@gmail.com> wrote:
> >
> > > Sir,
> > > thanks for reply in detailed manner, but I have multiple backups of my
> > > system, I want to store them in a table or some place which can be
> > > downloadable. Is there any way to accomplish this?
> >
> > > On Dec 19, 7:50 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> >
> > > > You uness you are customizing export_to_csv_file you can just do
> >
> > > > def myaction():
> > > >     import cStringIO
> > > >     file = cStringIO.StringIO()
> > > >     db(...).select().export_to_csv_file(file)
> > > >     return file.getvalue()
> >
> > > > and call withhttp://...../myaction.csvsothatyou get the right
> > > > content-type.
> >
> > > > The .csv does all the trink
> >
> > > > On Dec 19, 8:24 am, vvk <varunk.ap...@gmail.com> wrote:
> >
> > > > > I'm creating a csv file using db_export_to_csv. I want to make this
> > > > > csv file downloadable.
> > > > > "Download" function isn't allowing me to download this csv file
> > > > > because it's not present in any table. I thought of exporting csv
> file
> > > > > directly into a table, but unable to find any syntax for that. Any
> > > > > help would be greatly appreciated.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com<web2py%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to