Page 1 of 1
pls help its urgent
Posted: Mon Jan 14, 2008 9:23 pm
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...
Re: pls help its urgent
Posted: Mon Jan 14, 2008 9:25 pm
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.
Re: pls help its urgent
Posted: Mon Jan 14, 2008 9:30 pm
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
Re: pls help its urgent
Posted: Mon Jan 14, 2008 9:33 pm
by calguy1000
Because CMS Made Simple is PHP based, not ASP..... how are you including this script into your CMS Made simple site?
Re: pls help its urgent
Posted: Mon Jan 14, 2008 9:36 pm
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.........
Re: pls help its urgent
Posted: Tue Jan 15, 2008 4:23 pm
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.
Re: pls help its urgent
Posted: Wed Jan 16, 2008 12:04 am
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!!!!