Results 1 to 7 of 7

Thread: [RESOLVED] File Upload - Virtural Directories or Real?

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Resolved [RESOLVED] File Upload - Virtural Directories or Real?

    I am making a file uploader and i am going to have the option of the members using folders to organize their files, but should i have actual folders on the server, or just virtual directories like through my database
    My usual boring signature: Something

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: File Upload - Virtural Directories or Real?

    Virtual folders, if you're storing your uploaded files on a hard disk.

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: File Upload - Virtural Directories or Real?

    we already talked about this mendhak... lol. Thanks for bringing it up though, i need to set this as resolved.
    My usual boring signature: Something

  4. #4
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: [RESOLVED] File Upload - Virtural Directories or Real?

    I should throw my 2 cents into the mix.
    The way it should be implemented is that all the files, and related information, should be stored into the database. This way it prevents 'hotlinking' the file(s) from other sites. You can't easily control if a file is stored at yoursite.com/files but if its stored in a DB, they you have the ability to monitor/filter/pause before the actual download takes place (ie you might want to display an ad before they can download the file).
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [RESOLVED] File Upload - Virtural Directories or Real?

    Quote Originally Posted by k1ll3rdr4g0n
    I should throw my 2 cents into the mix.
    The way it should be implemented is that all the files, and related information, should be stored into the database. This way it prevents 'hotlinking' the file(s) from other sites. You can't easily control if a file is stored at yoursite.com/files but if its stored in a DB, they you have the ability to monitor/filter/pause before the actual download takes place (ie you might want to display an ad before they can download the file).
    Storing large files in a database is not a good idea s retrieving them is a lot slower than just opening a file on the server file system. My suggestion is storing the files in a directory outside the document root and assigning each one a unique ID and a virtual path in the database and saving the file with a name that corresponds with its unique ID.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    Fanatic Member
    Join Date
    Oct 2004
    Posts
    751

    Re: [RESOLVED] File Upload - Virtural Directories or Real?

    Quote Originally Posted by visualAd
    Storing large files in a database is not a good idea s retrieving them is a lot slower than just opening a file on the server file system. My suggestion is storing the files in a directory outside the document root and assigning each one a unique ID and a virtual path in the database and saving the file with a name that corresponds with its unique ID.
    That could work too...
    Actually that is a good idea.
    My Projects: [ Instant Messagener Client/Server ] [ VBPictochat ]

    My Sites:
    [ Datanethost ]
    [ Helpdesk ]

    Remember if my post was helpful then Rate This Post.

  7. #7

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: [RESOLVED] File Upload - Virtural Directories or Real?

    Quote Originally Posted by visualAd
    Storing large files in a database is not a good idea s retrieving them is a lot slower than just opening a file on the server file system. My suggestion is storing the files in a directory outside the document root and assigning each one a unique ID and a virtual path in the database and saving the file with a name that corresponds with its unique ID.
    that is exactly what i am doing.

    My script uploaded file 'mendhak.txt' and generates a new random name and stores it in /uploads/ directory which has forbidden access. The user never sees the generated name so they can never see the actual file.

    when they go to download the file, i read from file, but i read it as 'downloadfile.txt' and not as the random name.
    My usual boring signature: Something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width