attachment

Discussion in 'Python' started by ketulp_baroda@yahoo.com, Mar 3, 2004.

  1. Guest

    Hi
    I am trying to upload a file using <input type="file"....>
    I want to know what is the best way to store this uploaded file
    Should I store it in the databse??
    Or should I store the entire file on the server??
     
    , Mar 3, 2004
    #1
    1. Advertising

  2. Guest

    wrote in message news:<>...
    > Hi
    > I am trying to upload a file using <input type="file"....>
    > I want to know what is the best way to store this uploaded file
    > Should I store it in the databse??
    > Or should I store the entire file on the server??


    If I decide to store the file on the server,then di I have to use ftp
    to copy the file on the server??
     
    , Mar 6, 2004
    #2
    1. Advertising

  3. wrote:

    > wrote in message news:<>...
    >
    >>Hi
    >>I am trying to upload a file using <input type="file"....>
    >>I want to know what is the best way to store this uploaded file
    >>Should I store it in the databse??
    >>Or should I store the entire file on the server??

    >
    >
    > If I decide to store the file on the server,then di I have to use ftp
    > to copy the file on the server??


    No, the actual file contents is submitted as part of the HTTP POST request.
    (make sure you use method="post" and enctype="multipart/form-data" in your form).
    Python's cgi module knows how to deal with it.

    Where you store your file is entirely up to you and depends on what
    you want to do with it.

    --Irmen
     
    Irmen de Jong, Mar 6, 2004
    #3
  4. Guest

    Irmen de Jong <> wrote in message news:<4049ad99$0$564$4all.nl>...
    > wrote:
    >
    > > wrote in message news:<>...
    > >
    > >>Hi
    > >>I am trying to upload a file using <input type="file"....>
    > >>I want to know what is the best way to store this uploaded file
    > >>Should I store it in the databse??
    > >>Or should I store the entire file on the server??

    > >
    > >
    > > If I decide to store the file on the server,then di I have to use ftp
    > > to copy the file on the server??

    >
    > No, the actual file contents is submitted as part of the HTTP POST request.
    > (make sure you use method="post" and enctype="multipart/form-data" in your form).
    > Python's cgi module knows how to deal with it.
    >
    > Where you store your file is entirely up to you and depends on what
    > you want to do with it.
    >
    > --Irmen


    Hi
    Thanks for your reply.
    Ya the actual contents are posted along with the file.
    See my application is like this:
    User can submit any attachment and can view all the attachments
    submitted by other users.
    Attachment contents can be anything.
    So where should I store the attachment 1)In database 2)In a file on
    server
     
    , Mar 7, 2004
    #4
  5. wrote:

    > User can submit any attachment and can view all the attachments
    > submitted by other users.
    > Attachment contents can be anything.
    > So where should I store the attachment 1)In database 2)In a file on
    > server


    You give too little information to provide a conclusive answer.

    However,

    Putting stuff in a database can be complicated (BLOBs and stuff)
    but usually takes care of concurrency control (i.e. accessing the
    data by multiple users at the same time; everyone should only
    see THEIR file(s)).

    Storing stuff in the filesystem is by far the easiest. You don't
    have to set up and access a database. But you DO have to make sure
    that each file is uniquely named (you don't want me to overwrite
    your 'curriculum.doc' now do you) and probably have to do
    some concurrency control yourself.
    Also you have to think of a way to identify which files belong
    to which user, and make sure that user A cannot access user B's files.

    --Irmen
     
    Irmen de Jong, Mar 7, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    504
    Paul Lesnikowski
    Nov 10, 2005
  2. Matthew Lenz
    Replies:
    0
    Views:
    523
    Matthew Lenz
    Feb 22, 2005
  3. Michael Brennan

    File content / attachment fails in SSL

    Michael Brennan, Jul 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Michael Brennan
    Jul 7, 2003
  4. hunt n peck

    Attachment Disposition Bug

    hunt n peck, Aug 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    311
    hunt n peck
    Aug 14, 2003
  5. Bertus Dam
    Replies:
    0
    Views:
    449
    Bertus Dam
    Aug 26, 2003
Loading...

Share This Page