Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-06-23
9
Medium Priority
?
330 Views
Last Modified: 2012-06-27
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
Comment
Question by:Gary Gordon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 30

Expert Comment

by:third
ID: 7102414
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
 

Author Comment

by:Gary Gordon
ID: 7102466
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
 
LVL 30

Expert Comment

by:third
ID: 7102507
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Gary Gordon
ID: 7102591
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
 
LVL 30

Accepted Solution

by:
third earned 600 total points
ID: 7102643

<%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
 

Author Comment

by:Gary Gordon
ID: 7102712
third,

Still not working.

Gary
0
 
LVL 30

Expert Comment

by:third
ID: 7102716
any error message? can i see your code the part that has the file input and the target as well.
0
 

Author Comment

by:Gary Gordon
ID: 7103331
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
 
LVL 4

Expert Comment

by:Wakie
ID: 9355456
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question