SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2005
    Location
    N-472'26" W-12249'34"
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    File upload HTML/JS to ASP/SQL

    Howdy folks, I've written a few HTML/javascript web sites that push with ASP into SQL databases.

    The one thing I've never had to do is create a file upload, and now I'm having a heck of a time figuring out how to do that. I've got an input type=file and I have a preview if it's a picture that updates as it's changed, but how do I send the file to the server?

    I found one PHP example, but I'm not very familiar with PHP and would rather not have to learn it just for this (though it is on my to-do list anyway)

    Has anyone done this? Can you enlighten me as to what the next step is?

    Thanks in advance for your help!

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Where are you hosting your files? If it is with a hosting company they should provide some upload components for you to use.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2005
    Location
    N-472'26" W-12249'34"
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here in my office (I work for the state), we have our own servers for our sites/apps and we do have an FTP server I can hit against. In my personal stuff I have hosting companies and most if not all of them have FTP access.

    I was just curious what the actual code is to do this, as I can get the filename, but have never tried to pull the actual file, and I would like to know how to do it myself.

    thanks!

  4. #4
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ASP does not have file upload capabilities built-in, so it is a little tricky. That is why I suggested a component solution. There is a pure-code upload script out there, but it is not very reliable when it comes to larger/multiple files.

    I use ASPUpload religiously for file uploads!

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2005
    Location
    N-472'26" W-12249'34"
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is part of the reason I'd like to learn the nessicary code, I'd rather not shell out the 150$ they're asking.

    I mean really, there's a file input element, Is it really this difficult to make it do something?

  6. #6
    SitePoint Member
    Join Date
    Aug 2005
    Location
    Port Harcourt, Nigeria
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try jumping to this forum thread. I have one very useful FREE solution there. But you can't rename the uploaded file. This prooves that if another file with the same name is uploaded, the later will replace the first one.
    gfjhjnjkllkm**un*77ubajk;.JBJjnjNKkal,sl,ml,LL>,l,laskmskmls4dkn
    kmksmkmdm,MKMkmkMKSmksjkmkKJIKjkj(78989Ftcv{{]]\MklmO9mK
    M<==)h7&bhbHBU7y7yB^67t7vT&G^&6tGYGygyG&y78Y7&7t^T6t^*80uH

  7. #7
    SitePoint Member
    Join Date
    Aug 2005
    Location
    Port Harcourt, Nigeria
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try jumping to this forum thread. I have one very useful FREE solution there. But you can't rename the uploaded file. This prooves that if another file with the same name is uploaded, the later will replace the first one.

    http://www.sitepoint.com/forums/showthread.php?t=288264
    gfjhjnjkllkm**un*77ubajk;.JBJjnjNKkal,sl,ml,LL>,l,laskmskmls4dkn
    kmksmkmdm,MKMkmkMKSmksjkmkKJIKjkj(78989Ftcv{{]]\MklmO9mK
    M<==)h7&bhbHBU7y7yB^67t7vT&G^&6tGYGygyG&y78Y7&7t^T6t^*80uH

  8. #8
    SitePoint Zealot
    Join Date
    Jun 2005
    Location
    N-472'26" W-12249'34"
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He thanks kizer, I also found this one yesterday evening:
    http://www.stardeveloper.com/article...1042501&page=1

    and it's got some really good info too... My question now is: Why does this require so much code, it seems like something that would be in high enough demand that it would be a simple function call or could actually send the binary transfer when you submit the form...

    maybe someday...

  9. #9
    Guru Bullschmidt's Avatar
    Join Date
    Apr 2002
    Location
    USA
    Posts
    524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And here is a free pure ASP (i.e. no components) resource for letting the user upload a file which is something that was unfortunately not built into ASP:

    ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
    http://aspzone.com/articles/160.aspx
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


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
  •