Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61

    Red face Unanswered: Image uploading problem

    Hi there !

    I am using evaluation version FILEUP(Softartisians) product for uploading file. But when I trying to do so.. I am getting the following error...

    SoftArtisans.FileUp.1 error '80020009'
    Invalid or corrupt MIME headers. Please check the referring form's ENCTYPE

    /abc/post.asp, line 18

    -Line number 18 is rec = upl.Form("variable name ")..

    -Form page Enctype = "multipart/form-data"

    It would be great help, if anyone put some light on it.

    Hope to hear back soon.

    With Thanks,
    Sqlboy

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Post your code.

  3. #3
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61
    Form pge code..

    <form ENCTYPE="MULTIPART/FORM-DATA" method="post" action="postadd.asp" name="addfrm" onsubmit="return validate(addfrm)">
    <tr bgColor=#dedede><td><b>Category</b></td>
    <td><SELECT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" name=AD_TYPE>
    <% Do while not Res.EOF %>
    <option value=<%=Res("Type_id")%> selected><%=Res("Type_name")%></option>
    <%Res.MoveNext
    Loop
    %>
    </SELECT></td></tr>
    <TR bgColor=#dedede><td><B>AD Title</B></td><td><B>
    <input maxLength=50 size=43 name=AD_TITLE style="FONT-SIZE: 8pt; WIDTH: 276px; FONT-FAMILY: verdana; HEIGHT: 23px"></B></td></TR>
    <TR bgColor=#dedede><td><strong> Poster</strong> </td><td><b><%=Session("Userid")%></b></td></TR>
    <TR bgColor=#dedede><td><B>Durations</B></td>
    <td><SELECT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" name=AD_EXPIRED>
    <option value="<%= date+30%>" selected>30 days</option>
    <option value="<%= date+60%>">60 days</option>
    <option value="<%= date+90%>">90 days</option></SELECT></td></TR>
    <TR bgColor=#dedede><td><strong> Quantity</strong> </td>
    <td><input
    maxLength=5
    size=5 name=AD_QUANTITY
    style="FONT-SIZE: 8pt; FONT-FAMILY: verdana">&nbsp;(Optional)</td></TR>
    <TR bgColor=#dedede><td><B>Price</B></td>
    <td><input
    size=15
    name=AD_PRICE style="FONT-SIZE: 8pt; FONT-FAMILY: verdana"><strong> &nbsp;</strong> (Optional)</td></TR>
    <TR bgColor=#dedede><td><strong> Site URL</strong> </td>
    <td><input size=43 value=http://www. name=AD_LINK style="FONT-SIZE: 8pt; WIDTH: 272px; FONT-FAMILY: verdana; HEIGHT: 19px">&nbsp;(Optional)</td></TR>
    <TR bgColor=#dedede><td><strong> Image</strong> </td><td>
    <input type=file size=31 name=AD_IMAGE style="FONT-SIZE: 8pt; WIDTH: 269px; FONT-FAMILY: verdana; HEIGHT: 19px">&nbsp;(Optional)</td></TR>
    <TR bgColor=#dedede><td><strong> Description</strong> </td>
    <td><TEXTAREA style="FONT-SIZE: 8pt; FLOAT: left; WIDTH: 325px; FONT-FAMILY: verdana; HEIGHT: 198px" name=AD_DESCRIPTION rows=12 cols=37></TEXTAREA></td></TR>
    <TR bgColor=#dedede><TD align=right colSpan=2><INPUT style="FONT-SIZE: 8pt; FONT-FAMILY: verdana" type=submit value="Post My Ad" name=submit></TD></TR></form></table><!-- end middle column -->

    ---------------------------------------------------------------
    Post add code..

    <%
    'Makes the browser not cache this page

    Response.Expires = -1000 'Makes the browser not cache this page
    Response.Buffer = True 'Buffers the content so our Response.Redirect will work

    ' Declaring variables
    Dim categ, adtitle, poster, duration, quantity, price, siteurl, img, ad_desc, sql_insert,fcont,upload

    ' Uploading files into one directories

    Set upl = Server.CreateObject("SoftArtisans.FileUp")
    upl.path "D:\hshome\abc\abc.com\image"
    Set upl.Maxbytes = 300


    ' Receiving values from Form

    categ = upl.Form("ad_type")
    adtitle = upl.Form("ad_title")
    poster = Session("Userid")
    duration = upl.Form("ad_expired")
    quantity = upl.Form("ad_quantity")
    price = upl.Form("ad_price")
    siteurl = upl.Form("ad_link")
    img = upl.Form("ad_image")
    ad_desc = upl.Form("ad_description")
    FCONT = upl.ContentType
    if upl.Form(image").IsEmpty then
    img = "blank.gif"
    end if
    '--- Use the Select Case Condition to restrict the file type.
    Select Case LCase(FCONT)
    Case "image/gif"
    upl.Save
    Case "image/jpeg"
    upl.Save
    Case "image/bmp"
    upl.Save
    Case Else
    upl.delete
    upload=1
    End Select

    'file_name = upl.Shortfilename
    If not upload=1 then
    sql_insert = "insert into ads(ad_type, ad_title, ad_dated, ad_expired, ad_poster, ad_quantity, ad_price, ad_link, ad_image, ad_description, ad_viewed, ad_approved) values ('" & _
    categ & "', '" & adtitle & "', '" & poster & "', now(), & duration &, & quantity &, '" & price & "','" & siteurl & "', '" & img & "','" & ad_desc & "', 0 , 0)"

    ' Creating Connection Object and opening the database

    Set con = Server.CreateObject("ADODB.Connection")
    con.Open "DSN=abc;UID=abc;PWD=abc;DATABASE=abc"
    Set Rs = Server.CreateObject("ADODB.Recordset")
    con.Execute(sql_insert)
    else
    Response.Redirect("newadd.asp?upload=fail")
    end if
    %>

    With thanks !
    sqlboy

  4. #4
    Join Date
    Dec 2003
    Posts
    454
    Remove the keyword SET from the code

    Set upl.Maxbytes = 300

    It should be

    upl.Maxbytes = 300

    By the way, change the code

    if upl.Form(image").IsEmpty then

    to

    if upl.Form(img).IsEmpty then

  5. #5
    Join Date
    Mar 2003
    Location
    Memphis, TN, USA
    Posts
    61
    Thanks Guyan for your response.

    I followed as you suggested but still getting the same nasty error.

    SoftArtisans.FileUp.1 error '80020009'
    Invalid or corrupt MIME headers. Please check the referring form's ENCTYPE .

    I even removed all the checks and trying to do simple upload but no way i can get the success. If i provide the file name for upload then i get the error.. if not then also. And the most important things is.. i am getting the error on the same line.. viz... categ = upl.Form("ad_type")

    Ad_type is a combo box variable which is populated with one table field value.

    With Thanks,
    Sqlboy

  6. #6
    Join Date
    Dec 2003
    Posts
    454
    I created two test files for you to check if FileUp works on your computer.

    ---------- FileUpForm.asp ----------
    <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
    <form name="upload" method="post" action="FileUpProcess.asp" enctype="multipart/form-data">
    <tr>
    <td><input type="File" name="fileName"></td>
    </tr>
    <tr>
    <td><input type="Submit" name="Submit" value="Upload"></td>
    </tr>
    </form>
    </table>

    ----------FileUpProcess.asp ----------
    <%
    Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")
    oFileUp.Path = "D:/Temp"
    'oFileUp.CreateNewFile = True
    oFileUp.OverWriteFiles = False
    'oFileUp.Maxbytes = 300
    If Not oFileUp.Form("fileName").IsEmpty Then
    oFileUp.Form("fileName").Save
    If Err.Number <> 0 Then
    Response.Write "<B>Error description:</B> " & Err.Description
    Else
    Response.Write "File has been uploaded successfully."
    End If
    Else
    Response.Write "Error: There was no file submitted for upload"
    End If
    Set oFileUp = Nothing
    %>

  7. #7
    Join Date
    May 2007
    Posts
    2

    Thumbs up try registering the dll

    see here: http://support.softartisans.com/Foru...px?PostID=2794

    Go start, run: "regsvr32 safileup.dll"

    or try "regsvr32 C:\Progra~1\SoftArtisans\FileUp\safileup.dll" if safileup was installed in the default directory.

  8. #8
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    When I Had that error it was mixing data types

    Text feilds with a uploading feilds (I don't know what it means)
    try just doing the uploading with on other inputs
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  9. #9
    Join Date
    May 2007
    Posts
    2

    Talking

    mmm interesting. well i finally got mine to work...

    i had to do two things...

    1. Uninstall the COM+ services by running the uninstaller at:

    C:\Program Files\SoftArtisans\FileUp\SAFileUpTXUnInstall.vbs

    Which then produced the following error:

    ----------------------------------------
    Server object error 'ASP 0177 : 800401f3'

    Server.CreateObject Failed
    ----------------------------------------

    so to fix this:

    2. Registered safileup.dll by going Start > Run > "regsvr32 C:\Progra~1\SoftArtisans\FileUp\safileup.dll"

    both i learned from the link in my previous post....

    it's all working. happy days

  10. #10
    Join Date
    May 2007
    Posts
    3

    Try this Pure ASP upload script

    Take a look at this great pure ASP upload script and tutorial by Faisal Khan. No commercial components or DLLs required to make this work.

    http://www.stardeveloper.com/article...1042501&page=1


    David

Posting Permissions

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