SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone tell me if there is a script that already does this?

    I'm going to build a script that needs to accept .doc, .wpd, (binary) files from a form, and then link to the file. Each user/contractor can have a different set of files.

    Should I store the file into the database? After browsing some past posts on this, I dont' think so. I think I'll probably do this:

    1) On form submission, I'll generate a random number and create a new directory using this number. Then store this number in the db along with the name of the contractor.

    2) The submitted file(s) will get saved into this new directory, and then the db will associate the name of the file(s) with their location.

    When I want to display the file listings.. I can pull the name of the contractor, the directory, and the name of the file... format them and display as a link to the file for download.

    Make sense? Is there a script that already does this?



    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably not but it would be cinch to create.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya, I was hoping there'd be a finished script, though.. I'm getting better at PHP/mySQL, but it still isn't as quick as a "cinch". grin.

    I suppose practice makes perfect!
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  4. #4
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is unlikely that there is any scripts like this available. It is also (as freddy noted) not hard to create.

    If you have any questions someoen here will no doubt giev you an answer very quickly...

    Also, freddy have you just become an advisor or am i just showing early signs of demintia?
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope that is correct scary, eh?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    **Runs in terror**

    i'm looking for a script that will do exactly the same (cept with .td4 and .sv4 files)

    so ill keep looking
    Nearly 7 years old!

  7. #7
    SitePoint Evangelist mad-onion's Avatar
    Join Date
    Aug 2000
    Location
    Land of the long white cloud
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh know does this mean that the demise of free speech has begun freddy?

    Also you guys might consider working together to produce the system you need! Different file types would make little difference..
    SiteOptions >> Services :: Products :: Contact
    Developers of PHP, C++, Visual Basic, MySQL, and more!

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hstraf may I suggest a slightly different approach. Use the contractor's name as a unique identifier create the folder using the contractor name. Store the usernames and a password for each username in a database. Then simply create one script that will force the contractor to log in and set the username as a session variable, Now you can even use PHP's filesystem functions to display the contents of a directory using the session username variable. something like

    $dir = dir(/pathto/dirs/$contractorname");
    while ($file = $dir->read()) {
    if (($file != ".") && ($file != "..")) {
    printf('<a href="%s" target = "other">%s</a>', $file, $file);
    }
    }



    And also have a small form at the bottom that will upload files in the same fashion. You could use one script for everyone and the contents of the directory and the path to where the files get uploaded all depend on what the contractor logins with. You could really do this in about 100 lines of code. And have it work for an unlimited number of contractors as long as their username is unique.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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