Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[1615] Uploading Files with ASP

Last post 04-19-2005 7:05 AM by selvass. 96 replies.
Page 2 of 7 (97 items) < Previous 1 2 3 4 5 Next > ... Last »
Sort Posts: Previous Next
  • 10-24-2001 2:52 AM In reply to

    To extend the project slightly

    James:
     Yes I knew it was commented out but I searched high and low for that closed parentheses.  Remember with beginners such as I and word wrapping the way it is, these little issue can be confusing.

    James it works beutiful I want you to know.  I set the permissions correctly, I got that down.  I am trying to do this though.  Pretty much all that is going to be uploaded are jpegs.  I would like the confirmation page to show the uploaded jpeg.  But for the life of me I just can't get uploadcomplete.asp to show anything but what you have in the original ASP.  I tried to put in a HTML link back to the upload.asp.  Wouldn't show.  I tried to put in <img src="files/<%Request.Item("thefile")%>">.  Nothing.  No error, no mistake written to the browser.  Nothing.  It's as if I didn't put anything at all in uploadcomplete.asp.

    Can you explain to me why this is and maybe suggest how I can do what I'd like?  Do you thing the dll we have made is causing the uploadcomplete.asp to show nothing but what we use in the example?  Thanks.

    Oh and as a side note did you know that the uploadcomplete.asp is putting a "p" w/o quotes at the end of the ContentType; ex: a jpg uploaded shows:

    Content Type: image/pjpeg

    Strange don't you think?  why pjpeg?
    • Post Points: 0
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 11-06-2001 3:17 PM In reply to

    • cjanes
    • Not Ranked
    • Joined on 11-06-2001
    • New Member
    • Points 15

    Invalid ProgID

    I have tried to implement the ASPUploadComponent dll in my ASP project but I believe I haven't registered it correctly. The line of code that reads:
       Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")
    throws an ASP 0177 error - Invalid ProgID.

    Do you know what I am doing wrong?
    • Post Points: 0
  • 11-06-2001 3:40 PM In reply to

    • cjanes
    • Not Ranked
    • Joined on 11-06-2001
    • New Member
    • Points 15
    Nevermind - I figured it out. All I needed to do is make sure the name of the VB project is ASPUploadComponent, then make the dll. Everything works great!
    • Post Points: 0
  • 11-19-2001 3:42 PM In reply to

    • geoff
    • Not Ranked
    • Joined on 04-05-2001
    • United States
    • New Member
    • Points 25

    how to set file size limit

    I've compiled the code and it works perfectly.  However, in searching through it, I can't figure out where the file size limit is set.  Can anyone point me in the right direction here?  Thanks.
    • Post Points: 0
  • 11-20-2001 4:33 PM In reply to

    • miranda
    • Not Ranked
    • Joined on 11-20-2001
    • New Member
    • Points 25

    Adding more fields to the form

    The component works really well.
    Now I would like the user to add more information about the file in the upload form. I'd like to have the user choose in a listbox whether the file he wants to upload is a report, a track record, meeting document, so that I can save these search terms in the database.
    But since the enc-type in the form is:enctype="multipart/form-data", I can't catch this information with "Request.Form("DocContentType").
    How can I solve this problem? Do I have to create two different forms on separate pages? Please help...
    • Post Points: 0
  • 11-28-2001 1:39 PM In reply to

    • miranda
    • Not Ranked
    • Joined on 11-20-2001
    • New Member
    • Points 25

    Never mind

    I figured it out, sorry for not reading the manual carefully. For additional fields in the form, I can use objUpload.Form("Filedname").Value to get the value of the field.
    • Post Points: 0
  • 12-20-2001 1:15 PM In reply to

    • jaandres
    • Not Ranked
    • Joined on 12-20-2001
    • New Member
    • Points 60

    ASP Uploader

    Hi

    Say I will use the a file uploader. Some information of the file (like description) goes in a database (sql) and the uploaded file goes in a folder on the server harddisk.
    How do I delete a file on the server and its record in the database at the same time when pressing "delete.

    Jannike
    • Post Points: 0
  • 12-20-2001 2:07 PM In reply to

    • Yuri
    • Not Ranked
    • Joined on 12-20-2001
    • New Member
    • Points 5
    In the code that processes the action for your form
    1. use the fso to delete the file like this: in VBScript:
    Dim fso
    Set fso = CreateObject ("Scripting.FileSystemObject")
    Set f = fso.GetFile("C:\Folder\file.ext")
    f.Delete

    and,
    2. with ado run the sql "DELETE FROM tablename WHERE ColumnName=valuetodelete" like this in VBScript:
    Dim conn
    Dim execdelete
    set conn = CreateObject("ADODB.Connection")
    conn.Open ("Connection string here")
    Set execdelete = conn.execute("DELETE FROM tablename WHERE ColumnName=valuetodelete")
    conn.close
    set conn = nothing

    That should be more than enough to get you started. Check out the excellent downloadable documentation that MS has on their scripting site for more info.
    • Post Points: 0
  • 12-21-2001 2:04 PM In reply to

    • miranda
    • Not Ranked
    • Joined on 11-20-2001
    • New Member
    • Points 25

    Uploading to different computer

    Hi folks,
    I'm trying to get the component to upload the file to a share on a different computer in the intranet network. We do not want the files to be saved on the webserver, but on a different machine. It seems to me that just setting the Uploadpath-string in the ASP-code to the unc path of the share would be enough, but for some reason, this doesn't work. I get the message "The folder to upload to doesn't exist." when trying to upload.
    I would be very grateful for any advise that would help me solve this problem.
    • Post Points: 0
  • 02-01-2002 1:59 AM In reply to

    • srs123
    • Not Ranked
    • Joined on 02-01-2002
    • New Member
    • Points 20

    Downloading a folder from FTP Server

    Hi all,

    Can any body help me in writing a script for "downloading a folder from FTP Server (Unix Box) to local system (windows 2000) using vb 6.o"

    thankx in advance

    SRS
    • Post Points: 0
  • 02-12-2002 11:32 AM In reply to

    • James Crowley
    • Top 10 Contributor
    • Joined on 12-07-2000
    • United Kingdom
    • Guru
    • Points 15,055
    • SystemAdministrator
    a long delay, but maybe it will help someone else with the same problem

    You don't specify a file-size limit as such... instead, you check the field that has your file in (such as objUpload.Form("thefile")), and check it's filesize property... ie

    if (objUpload.Form("thefile").FileSize > 1000) then
     'too big
    end if
    • Post Points: 0
  • 02-27-2002 6:25 AM In reply to

    • owitte
    • Not Ranked
    • Joined on 02-26-2002
    • Junior Member
    • Points 70

    error in FileSize property

    Hi James,
    you asked me to post any comments about your control here, so here I am

    I just checked your code, and, me too, I can't figure out why the FileSize property always return the double filesize. But it seems to be always like that, so why don't you just change the Property Get code from

    Code:
    FileSize = GetVal("FileLen")


    to

    Code:
    FileSize = GetVal("FileLen")/2


    I know, this is not the 'professional's solution', but it'll work for now, at least until you or somebody else has the time to step deep into your code...

    Anyway, am I the first and only one who found out about that...?

    And now for something completely different: Some other folks posted already that there's a documentation error concerning the object creation: In your asp code, it says

    Code:
    Set objUpload = Server.CreateObject("UploadIt.cUpload")


    to create the object. Maybe you wanted to rename your project to UploadIt, but then forgot to do so, so actually, the correct code is

    Code:
    Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")


    You should change that in your example pages in order to avoid more forum messages from people who cannot figure this out by themselves...

    HTH
    Oliver
    • Post Points: 0
  • 02-27-2002 9:55 AM In reply to

    • James Crowley
    • Top 10 Contributor
    • Joined on 12-07-2000
    • United Kingdom
    • Guru
    • Points 15,055
    • SystemAdministrator
    Thanks for that. I shall update the tutorial
    • Post Points: 0
  • 02-27-2002 9:57 AM In reply to

    • James Crowley
    • Top 10 Contributor
    • Joined on 12-07-2000
    • United Kingdom
    • Guru
    • Points 15,055
    • SystemAdministrator
    hmmm.... is it just the source code that has that incorrect line? The tutorial has
    Code:
    Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")
    • Post Points: 0
  • 02-27-2002 11:18 AM In reply to

    • owitte
    • Not Ranked
    • Joined on 02-26-2002
    • Junior Member
    • Points 70
    yeah, it's just the sample page, then. I didn't check the tutorial, though...
    • Post Points: 0
Page 2 of 7 (97 items) < Previous 1 2 3 4 5 Next > ... Last »