pls help its urgent

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
ankitm

pls help its urgent

Post by ankitm »

Hello,

I set up a site and am working on the  form. I added 1 file upload fields for users to be able to upload textfiles/docs/ and such... and i m using "freeaspuploadsript" After submitting the form is supposed to email the contents of the form (which it does) and all the text goes through except for the uploaded files (as attachments) as I should expect it should work.

Any idea on how to fix this would be greatly appreciated...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: pls help its urgent

Post by calguy1000 »

if you had posted your information about CMS Made simple, and some actual details maybe somebody could help you..... if you don't.... you're just wasting your time and ours.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
ankitm

Re: pls help its urgent

Post by ankitm »

sry here is the code of asp upload file




Folder " & uploadsDirVar & " does not exist.The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
        exit function
    end if
    fileName = uploadsDirVar & "\test.txt"
    on error resume next
    Set testFile = fso.CreateTextFile(fileName, true)
    If Err.Number0 then
        TestEnvironment = "Folder " & uploadsDirVar & " does not have write permissions.The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions."
        exit function
    end if
    Err.Clear
    testFile.Close
    fso.DeleteFile(fileName)
    If Err.Number0 then
        TestEnvironment = "Folder " & uploadsDirVar & " does not have delete permissions, although it does have write permissions.Change the permissions for IUSR_computername on this folder."
        exit function
    end if
    Err.Clear
    Set streamTest = Server.CreateObject("ADODB.Stream")
    If Err.Number0 then
        TestEnvironment = "The ADODB object Stream is not available in your server.Check the Requirements page for information about upgrading your ADODB libraries."
        exit function
    end if
    Set streamTest = Nothing
end function

function SaveFiles
    Dim Upload, fileName, fileSize, ks, i, fileKey

    Set Upload = New FreeASPUpload
    Upload.Save(uploadsDirVar)

' If something fails inside the script, but the exception is handled
If Err.Number0 then Exit function

    SaveFiles = ""
    ks = Upload.UploadedFiles.keys
    if (UBound(ks) -1) then
        SaveFiles = "Files uploaded: "
        for each fileKey in Upload.UploadedFiles.keys
            SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
        next
    else
        SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."    end if
'Response.Redirect ("aus-regonline.asp?FileName=" & FileName)
end function


Dim diagnostics
if Request.ServerVariables("REQUEST_METHOD") "POST" then
    diagnostics = TestEnvironment()
    if diagnostics"" then
        response.write ""
        response.write diagnostics
        response.write "After you correct this problem, reload the page."
        response.write ""
    else
        response.write ""
     
        response.write ""
    end if
else
    response.write ""
   
    response.write SaveFiles()
    response.write ""
end if

%>

the highlight part is the result wht i get can u pls tell me wht i m doing wrong bcoz the script works fine with normal html page but it doesnt work with cmsmadesimple
Last edited by ankitm on Mon Jan 14, 2008 9:32 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: pls help its urgent

Post by calguy1000 »

Because CMS Made Simple is PHP based, not ASP..... how are you including this script into your CMS Made simple site?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
ankitm

Re: pls help its urgent

Post by ankitm »

then how come my form2mail script which is in asp works fine with cmsmadesimple form and upload form doesnt, and i m just using cms to make form after tht this is external asp file which should just upload the file and move to next page for conent to mail.........
Last edited by ankitm on Mon Jan 14, 2008 9:37 pm, edited 1 time in total.
Pierre M.

Re: pls help its urgent

Post by Pierre M. »

Hello,
ankitm wrote: sry here is the code of asp upload file
This forum is not about debugging ASP code. It is about resolving issues of CMSms not working as expected.
If you have an issue of integrating a third party software, why not ask in that software's forum ?

Pierre M.
hexdj
Power Poster
Power Poster
Posts: 415
Joined: Sat Mar 24, 2007 8:28 am

Re: pls help its urgent

Post by hexdj »

@ankitm

I told you already in a couple of different posts to use the Form Builder module. Were you paying attention?.

It allows you to upload files!!!!
Post Reply

Return to “Developers Discussion”