On Sat, Sep 24, 2011 at 3:03 AM, slah <slach...@gmail.com> wrote:
> Hello,
> I'm about to implement such function in my project.
> It will be great if you can share your experience.
>

Would you need to use authentication?

I am working on a download process that requires auth

so I have a cgi (that will take credentials) return the file

here is my sample code (I don't have the auth done, it will just
passed as a url parameter for my first try)

#!/usr/bin/python



import cgitb
import sys
import cgi
import os
import platform
from enfdata import Common

cgitb.enable()


def download():
    """
    Returns the demo file
    """
    form = cgi.FieldStorage()
    path = form['path'].value
    mainDir=Common.EnFuzionCommand("cluster get ENFMAIN_DIRECTORY").strip()
    FILENAME = mainDir+'/'+path
    sys.stderr.write('Filename: '+FILENAME)
    file = open(FILENAME, 'rb')
    buff = file.read()
    print 
"Content-Type:image\nContent-Disposition:attachment;filename=%s\nContent-Length:%s\n"
%    (os.path.split(FILENAME)[-1], len(buff))
    if sys.platform.find("win32") == 0:
        import msvcrt
        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
    print buff
download()

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to