Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2006, 06:53 AM
Registered User
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default file uploading

hi everybody,
     i have a problem in uploading files.
from a combo box have to select either Customer or Partner
a list of customer/partner will be listed with checkbox.

for the selected customer/partner files have to be uploaded

my problem is
checkbox value is null after form submission

here the code for save the file

function SaveMyFiles
    Dim Upload, fileName, fileSize, ks, i, fileKey,sp,cnt,temp,flag


    Set Upload = New UploadMyFile
    UploadDir=UploadDir&"s"
    Response.Write(UploadDir)
    'Upload.Save(UploadDir)
    Response.Write(Upload.Form("seltyp")) returns null
    Response.Write(Upload.Form("customerchk"))returns null
    'if lcase(Upload.Form("seltyp"))="Customer" then
    Response.Write(Upload.Form("f1"))
    if Upload.Form("seltyp")="Customer" then

        sp=split(trim(Upload.Form("customerchk")),",")
        cnt=ubound(sp)
        Response.Write(cnt)
        temp=UploadDir
        for i=0 to ubound(sp)
            Response.Write(sp(i))
            UploadDir=temp&"\"&trim(sp(i))
            Upload.Save(UploadDir)
        next
    end if
    ' If something fails inside the script, but the exception is handled

    Response.write err.description
    If Err.Number<>0 then Exit function

    SaveMyFiles = ""
    ks = Upload.UploadedFiles.keys
    if (UBound(ks) <> -1) then
        SaveMyFiles = "<B>Files uploaded:</B> "
        for each fileKey in Upload.UploadedFiles.keys

                dim fs
                set fs=server.CreateObject("Scripting.filesystemobject ")
                if lcase(Upload.Form("seltyp"))="Customer" then
                    fs.Deletefile(temp&"\"&Upload.UploadedFiles(fileKe y).FileName)
                end if

            SaveMyFiles = SaveMyFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
        next
    else
   ' SaveMyFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
        flag=1
    end if


'Use Upload.Form instead of Request.form. SaveMyFiles = SaveMyFiles & "<br>Enter a number = " & Upload.Form("enter_a_number") & "<br>"
' SaveMyFiles = SaveMyFiles & "Checkbox values = " & Upload.Form("checkbox_values") & "<br>"
end function


 
Old August 28th, 2006, 11:42 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please paste code for displaying data from combo box

Om Prakash
 
Old September 3rd, 2006, 11:52 PM
Authorized User
 
Join Date: Jun 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

> i have a problem in uploading files.

>my problem is
>checkbox value is null after form submiss

Uploading files and checkbox value are 2 different things.

If you are experiencing issues with multi select boxes and a call to binary read then its because ASP does not support multi select boxes with binary read and will only return the first value selected in your multiselect box.

Earl
www.jhdesigninc.com






Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading a file MunishBhatia ASP.NET 2.0 Professional 4 May 30th, 2007 04:18 AM
Uploading a file with ASP BananaJim Classic ASP Professional 1 December 7th, 2006 06:57 PM
Uploading File misskaos Classic ASP Basics 4 October 26th, 2006 02:56 PM
FIle Uploading [email protected] Classic ASP Basics 3 February 23rd, 2004 12:32 PM
File uploading zabedin Classic ASP Basics 1 July 16th, 2003 08:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.