Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

I have an ASPUpload script that I need converted to ASP Simple Upload. HELP??

I have a script that works fine with ASPUpload.  But a new server I am on doesn't have this .. and it only has ASP Simple Upload.  I simply need BIG help in converting the code so it will do the same thing .. but using ASP Simple Upload as opposed to the prior ASPUpload.

If you can help me .. here's the ASPUpload script.

I just need it re-done.

Also, I need it to write the files to a folder that is below the root folder of the website, in a folder already called   "database" .   That's about the only change.  Everything else stays exactly the same.

I kind of need help on this asap.  And, if I get it working quickly, I will gladly double the points.

Thanks,
Gary

Here's the current ASPUpload script.  (The form page forwards the info to this asp script for processing.)


<%response.buffer=true%>
<html>
<head>
     <title>Gordon Designs - Response Form</title>
</head>

<body bgcolor="white">
<h3><font face="arial">Thank You</font></h3>

<%

dim urlSendTo
urlSendTo  = "thankyou_emaillist.asp"

Set oUpload = Server.CreateObject("Persits.Upload.1")

oUpload.OverwriteFiles = false 'Create unique filenames by appending (1),(2) ... (n)
FileCount = oUpload.SaveVirtual("/files") 'This needs to be changed so it writes to a folder called (database) which is located one folder beneath the root folder.

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName   = "Gordon Designs"
Mailer.FromAddress= "info@gordondesigns.com"
Mailer.RemoteHost = "mail.gordondesigns.com"
Mailer.AddRecipient "Gordon Designs", "ggordon@gordondesigns.com"

'Mailer.AddRecipient Request.Form("recipient"), Request.Form("recipient")

Mailer.Subject = "Gordon Designs - Email Data"

strMsgHeader = " - Email Form Information Follows - " & vbCrLf & vbCrLf

'this routine has changed.  You can use the request object with uploading....
'instead of Request.Form you must use uploadobject.form as below

'for each qryItem in oUpload.Form
for each qryItem in oUpload.Form
'   strMsgInfo = strMsgInfo &  qryItem & " :: " & oUpload.Form(qryItem) & vbCrLf & vbCrLf
   strMsgInfo = strMsgInfo &  qryItem.name & " :: " & qryItem.value & vbCrLf & vbCrLf
next

'If items were uploaded, attachthem to this email.
If FileCount > 0 Then
     for each file in oUpload.Files
          Mailer.AddAttachment(Server.MapPath("/files/" & file.filename))
     Next
End If
strMsgFooter = vbCrLf & vbCrLf & " - End Of This Email Form Information - " & vbCrLf

Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter & vbcrlf & FileCount & " files attached."


if Mailer.SendMail then
  'Response.Write "Form information submitted..."
  Response.Redirect urlSendTo

else

  Response.Write "Mail send failure. Error was " & Mailer.Response

end if

set Mailer=nothing

%>

</body>
</html>


Please help asap. And if you have any comments about how to fix up the above code, that would also be appreciated.

Thanks!!
Gary

0
Gary Gordon
Asked:
Gary Gordon
  • 4
  • 4
1 Solution
 
thirdCommented:
i think the script was from a SMTP mail component rather than from a ASPUpload component. when you upload a file to a server the local file on your pc is being sent to the server on the desired directory while when you send a mail having an attachement, your local file is sent to an email address and the attachment can only be retrieve by downloading again the file from the POP Mail server where the mail was sent.

anyway, if you need to know more about how to use ASP Simple Upload this link provides a detailed explanation/documentation about using the component. it includes examples too.

http://www.asphelp.com/ASPSimpleUpload/Docs/Default.htm


regards,

third
0
 
Gary GordonWebsite Developer, Designer, SEO and Online Marketing specialist.Author Commented:
third,

I guess what I need and was hoping someone like you might be able to help me with is .. to simply take the original script .. and just modify what is needed so it will work with ASP Simply Upload.

Is this something you can help me with??

Gary
0
 
thirdCommented:
try this,


Example1.asp  
-----------------
<%
 Option Explicit
   
 Dim upl, FileName
   
 Set upl = Server.CreateObject("ASPSimpleUpload.Upload")
 
 If Len(upl.Form("File1")) > 0 Then
     FileName = upl.ExtractFileName(upl.Form("File1"))
     If upl.SaveFile("File1","c:\Inetpub\database\" & FileName) Then
         Response.Write("File successfully written to disk.")  
     Else
         Response.Write("There was an error saving the file to disk.")
     End If
 End If
 %>
   
 <html><head><title>ASP Simple Upload Example #1</title></head></title>
 <body>
 <form method="POST" action="Example1.Asp" enctype="multipart/form-data">
 
 Select a file to upload: <input type="file" name="File1" size="30">
 <input type="submit" name="submit" value="Upload Now">
 </form>
 </body>
</html>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Gary GordonWebsite Developer, Designer, SEO and Online Marketing specialist.Author Commented:
third,

I appreciate the effort, but it is not what I need.

If you can, simply take the code I wrote above (initially) and modify it to work with ASP Simple Upload.

Thanks,
Gary
0
 
thirdCommented:

<%response.buffer=true%>
<html>
<head>
    <title>Gordon Designs - Response Form</title>
</head>

<body bgcolor="white">
<h3><font face="arial">Thank You</font></h3>

<%
dim urlSendTo, filepath
urlSendTo  = "thankyou_emaillist.asp"
filepath   = "c:\Inetub\database\"

Dim upl, FileName
 
Set upl = Server.CreateObject("ASPSimpleUpload.Upload")
 
If Len(upl.Form("File1")) > 0 Then
    FileName = filepath & upl.ExtractFileName(upl.Form("File1"))
    If upl.SaveFile("File1",FileName) Then
      'Response.Write "Form information submitted..."
      Response.Redirect urlSendTo
    Else
        Response.Write("There was an error saving the file to disk.")
    End If
End If
%>
</body>
</html>


before this you should have a form that will look like where you will input the file to be attached. just change the form action as desired.

<html><head><title>ASP Simple Upload Example #1</title></head></title>
<body>
<form method="POST" action="upload.asp" enctype="multipart/form-data">

Select a file to upload: <input type="file" name="File1" size="30">
<input type="submit" name="submit" value="Upload Now">
</form>
</body>
</html>
0
 
Gary GordonWebsite Developer, Designer, SEO and Online Marketing specialist.Author Commented:
third,

Still not working.

Gary
0
 
thirdCommented:
any error message? can i see your code the part that has the file input and the target as well.
0
 
Gary GordonWebsite Developer, Designer, SEO and Online Marketing specialist.Author Commented:
Third,

Aside from the "FILEPATH" c:\Inetub\database\ ... can you simply take my exact thing that I put above ... fix it so it should work with ASP Simple Upload and paste it back in here.  Then, I should be able to copy and paste it and it should work.

Can you try that and then I'll let you know what I get.  That's really what I think I need.

Thanks,
Gary
0
 
WakieCommented:
It appears this question has been abandoned.

I will leave a recommendation in the Cleanup topic area that this question will be:

- Points to third -

Please leave any comments here within the next seven days.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Wakie,
EE Cleanup Volunteer.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now