ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 21st, 2006, 07:22 PM
kanenas.net kanenas.net is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Location: Athens-Greece
Posts: 24 kanenas.net User rank is Corporal (100 - 500 Reputation Level)kanenas.net User rank is Corporal (100 - 500 Reputation Level)kanenas.net User rank is Corporal (100 - 500 Reputation Level)kanenas.net User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 21 h 7 m 19 sec
Reputation Power: 0
Send a message via ICQ to kanenas.net Send a message via MSN to kanenas.net Send a message via Yahoo to kanenas.net
(regarding this thread)

Ok ! The code works perfect !!!

But what should I do in order to e-mail the files uploaded ?
What I mean is that when the files are uploaded I also want to be e-mailed at the same time...
So far I had tried this...
http://forums.aspfree.com/asp-development-5/upload-files-and-send-e-mail-using-cdosys-133826.html

I could really use some help with this !

Thanks

Last edited by Shadow Wizard : January 18th, 2007 at 07:25 AM.

Reply With Quote
  #2  
Old September 22nd, 2006, 06:20 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
copy the function SendEmail from here:
http://forums.aspfree.com/code-bank...nent-49734.html
having this function, add such line to the upload code:
Code:
strFileName = "new_file"
Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), strFileName)
SendEmail("someone@something.com", "your@email.com", "sending file", "hello how are you?", Array(Server.MapPath("Uploads/" & strFileName)))

this will save the file and email it using CDO component.

Reply With Quote
  #3  
Old December 25th, 2006, 07:01 AM
Lestat Lestat is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Lestat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 0
Red face Getting Upload Script to Work with CDO.SYS

Hello Shadow,

Was trying to implement your ShadowUpload Script into my existing form and e-mail the result to a user with the attached file. But somehow I keep running into the following error. Could you be so kind as to be of assistance?

My Code :
ApplyJob.asp (Where by original form comes from)
Code:
        <form action="EmailSent.asp" method="post" enctype="multipart/form-data" name="frmJobApplication" id="frmJobApplication">
          <table width="700" border="0" align="center">
            <tr>
              <td><span class="style11">Job ID : </span></td>
              <td><%=(Recordset1.Fields.Item("JobsID").Value)%> <input name="txtJobID" type="hidden" id="txtJobID" value="<%=(Recordset1.Fields.Item("JobsID").Value)%>"></td>
            </tr>
            <tr>
              <td width="124"><span class="style11">Position  : </span></td>
              <td width="460"><%=(Recordset1.Fields.Item("Position").Value)%> <input name="txtPosition" type="hidden" id="txtPosition" value="<%=(Recordset1.Fields.Item("Position").Value)%>"></td>
            </tr>
            <tr>
              <td><span class="style11">Company Name : </span></td>
              <td><%=(Recordset1.Fields.Item("CompanyName").Value)%>
              <input name="txtCompanyName" type="hidden" id="txtCompanyName" value="<%=(Recordset1.Fields.Item("CompanyName").Value)%>"></td>
            </tr>
            <tr>
              <td><span class="style11">Your E-mail : </span></td>
              <td><input name="txtEmail" type="text" id="txtEmail" size="70"></td>
            </tr>
            <tr>
              <td><span class="style11">Subject : </span></td>
              <td><input name="txtSubjectFake" type="text" id="txtSubjectFake" value="Application for the post of <%=(Recordset1.Fields.Item("Position").Value)%> via JobsWalk.com" size="70"> 
              <input name="txtSubject" type="hidden" id="txtSubject" value="Application for the post of <%=(Recordset1.Fields.Item("Position").Value)%> via JobsWalk.com"></td>
            </tr>
            <tr>
              <td><span class="style11">Cover Letter : </span></td>
              <td><textarea name="txtCoverLetter" cols="70" rows="15" id="txtCoverLetter">Dear Sir/Madam,

I wish to apply for the position above, as advertised on JobsWalk.com on <%=(Recordset1.Fields.Item("DateRegistered").Value)%>.

[Please add the rest of your message here.]

Thank you.

Sincerely
[Your Name]</textarea></td>
            </tr>
            <tr>
              <td><span class="style11">Attach Resume </span></td>
              <td><span class="style11">
                <input name="fileAttachResume" type="file" id="fileAttachResume" size="60">
                <br>
              *Kindly save your resume in your C:\ Drive before attaching. </span></td>
            </tr>
            <tr>
              <td><span class="style11"></span></td>
              <td><input type="submit" name="Submit" value="Submit"></td>
            </tr>
          </table>
        </form>

EmailSent.asp (Where I intend to e-mail with attachment)
Code:
<!-- #include file="ShadowUploader.asp" -->
<%
Set objUpload=New ShadowUpload
For x=0 To objUpload.FileCount-1
	Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
	Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
	Response.Write("file size: "&objUpload.File(x).Size&"<br />")
	Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
	Response.Write("file saved successfully!")
	Response.Write("<hr />")
Next
%>

<%
If Trim(Request.Form("Submit")) <> "" Then
Set myMail = CreateObject("CDO.Message")
myMail.Subject = Trim(Request.Form("txtSubject"))
myMail.From = Trim(Request.Form("txtEmail"))
myMail.To = "kevinloh@jobswalk.com"
myMail.TextBody = Trim(Request.Form("txtCoverLetter"))
myMail.AddAttachment Trim(objUpload("fileAttachResume"))
'myMail.AddAttachment Trim(Request.Form("fileAttachResume"))
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
myMail.Configuration.Fields.Update
myMail.Send
Set myMail = nothing
End If
%>

Error Message :
Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/jobs/ShadowUploader.asp, line 283


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)

Page:
POST 22226 bytes to /jobs/EmailSent.asp

POST Data:
error '80020009'
Exception occurred.

/iisHelp/common/500-100.asp, line 223
==============================================
Apologies if this post is too long. But really do need your help.
Thanks

Last edited by Shadow Wizard : December 25th, 2006 at 07:14 AM. Reason: added [Code] and [/Code] tags around code - please do that yourself next!

Reply With Quote
  #4  
Old December 25th, 2006, 07:17 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
you must have folder called "Uploads" under the folder
where the ASP script is located, and over this folder
grant Read/Write/Execute permissions to the IUSR
user account of the web server.

full guide about setting permissions can be found here:
http://forums.aspfree.com/asp-devel...uide-96087.html
(just give the permissions to the whole folder instead of single MDB file)

Reply With Quote
  #5  
Old December 25th, 2006, 11:36 AM
Lestat Lestat is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Lestat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 0
Red face Code Works with IIS Locally but not remotely?

Quote:
Originally Posted by Shadow Wizard
you must have folder called "Uploads" under the folder
where the ASP script is located, and over this folder
grant Read/Write/Execute permissions to the IUSR
user account of the web server.

full guide about setting permissions can be found here:
(URL address blocked: See forum rules)
(just give the permissions to the whole folder instead of single MDB file)


Dear Shadow Wizard,
Managed to get your code and my CDO.SYS e-mail to work properly when I test it on my own desktop with IIS after modifying the permissions as above. But when I uploaded the whole code to my hosting company. I get another error message. This time not so friendly :

EmailSent.asp
[code]
<!-- #include file="ShadowUploader.asp" -->
<%
Set objUpload=New ShadowUpload
For x=0 To objUpload.FileCount-1
' Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
' Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
' Response.Write("file size: "&objUpload.File(x).Size&"<br />")
Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
' Response.Write("file saved successfully!")
' Response.Write("<hr />")
Next
%>

<%
'changing all Request.Form to objUpload
If Trim(objUpload("Submit")) <> "" Then
Set myMail = CreateObject("CDO.Message")
myMail.Subject = Trim(objUpload("txtSubject"))
myMail.From = Trim(objUpload("txtEmail"))
myMail.To = "kevinloh@jobswalk.com"
myMail.TextBody = Trim(objUpload("txtCoverLetter"))
myMail.AddAttachment Trim(objUpload("fileAttachResume"))
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
myMail.Configuration.Fields.Update
myMail.Send
Set myMail = nothing
End If
%>
[code]

Error Message :
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

-----------------------------------------------------------

Please try the following:

Open the (URL address blocked: See forum rules) home page, and then look for links to the information you want.
Click the Refresh button, or try again later.

Click Search to look for information on the Internet.
You can also see a list of related sites.




HTTP 500 - Internal server error
Internet Explorer

Do U suppose it is also because of the permissions settings in my hosting server as well? Appreciate your kind wisdom.

Reply With Quote
  #6  
Old December 25th, 2006, 11:43 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
in your IE browser, click Tools --> Internet Options.
go to the Advanced tab, untick the checkbox "show
friendly http error messages" and confirm.
reload the page and you shoud see real error message.
yes that's most probably due to permissions, you better
contact your host and ask them where you can store files.

Reply With Quote
  #7  
Old December 25th, 2006, 01:04 PM
Lestat Lestat is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Lestat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 0
Red face A more meaningful Error Message.

Quote:
Originally Posted by Shadow Wizard
in your IE browser, click Tools --> Internet Options.
go to the Advanced tab, untick the checkbox "show
friendly http error messages" and confirm.
reload the page and you shoud see real error message.
yes that's most probably due to permissions, you better
contact your host and ask them where you can store files.


Dear Shadow Wizard,

Here is the more meaningful error message once I untick the friendly error message option.

Microsoft VBScript runtime error '800a01a8'

Object required: 'm_Files'

/ShadowUploader.asp, line 18

The above doesn't look like a permission error. Any ideas?

Reply With Quote
  #8  
Old December 25th, 2006, 02:50 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
in your code, you're missing this line:
Code:
Set objUpload=New ShadowUpload

you must add this line before trying to read the files.

Reply With Quote
  #9  
Old December 25th, 2006, 11:13 PM
Lestat Lestat is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Lestat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 0
Red face Cannot find path in Upload Script

Quote:
Originally Posted by Shadow Wizard
in your code, you're missing this line:
Code:
Set objUpload=New ShadowUpload

you must add this line before trying to read the files.


Dear Shadow,

Managed to get my web provider to change the permissions for me and added in the Set objUpload=New ShadowUpload into my script. However, now it says the following error message :

CDO.Message.1 error '80070003'

The system cannot find the path specified.

/EmailSent.asp, line 95

My code for EmailSent.asp
Code:
<%
Set objUpload=New ShadowUpload
For x=0 To objUpload.FileCount-1
'	Response.Write("file name: "&objUpload.File(x).FileName&"<br />")
'	Response.Write("file type: "&objUpload.File(x).ContentType&"<br />")
'	Response.Write("file size: "&objUpload.File(x).Size&"<br />")
	Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")
'	Response.Write("file saved successfully!")
'	Response.Write("<hr />")
Next
%>

<%
'changing all Request.Form to objUpload
If Trim(objUpload("Submit")) <> "" Then
Set myMail = CreateObject("CDO.Message")
myMail.Subject = Trim(objUpload("txtSubject"))
myMail.From = Trim(objUpload("txtEmail"))
myMail.To = "kevinloh@jobswalk.com"
myMail.TextBody = Trim(objUpload("txtCoverLetter"))
myMail.AddAttachment Trim(objUpload("fileAttachResume"))
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
myMail.Configuration.Fields.Update
myMail.Send
Set myMail = nothing
End If
%>


Line 95 :
myMail.AddAttachment Trim(objUpload("fileAttachResume"))

where fileAttachResume is the File Field Name I am trying to get from my form.

Is there anyway I can change the code in Line 95 to read from the wwwroot\Uploads\<filename> ?

By default, Line 95 will simply take the full path of the file.

Your help is most appreciated.

Thank you.

Lestat

Reply With Quote
  #10  
Old December 26th, 2006, 01:23 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
sure Lestat, here is the correct syntax for this:
Code:
Set objUpload=New ShadowUpload

If objUpload.FileCount>0 Then
	Call objUpload.File(0).SaveToDisk(Server.MapPath("Uploads"), "")
End If

'changing all Request.Form to objUpload
If Trim(objUpload("Submit")) <> "" Then
	Set myMail = CreateObject("CDO.Message")
	myMail.Subject = Trim(objUpload("txtSubject"))
	myMail.From = Trim(objUpload("txtEmail"))
	myMail.To = "kevinloh@jobswalk.com"
	myMail.TextBody = Trim(objUpload("txtCoverLetter"))
	
	If objUpload.FileCount>0 Then
		myMail.AddAttachment Server.MapPath("Uploads") & "\" & objUpload.File(0).FileName
	End If
	
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
	myMail.Configuration.Fields.Update
	myMail.Send
	Set myMail = nothing
End If

changes are marked in bold, I've also added code that will attach
only if any file has been uploaded, to avoid errors.
Comments on this post
chapman10s agrees: very useful...

Reply With Quote
  #11  
Old December 26th, 2006, 10:42 AM
Lestat Lestat is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Lestat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 0
Red face Deleting Attachment after sending E-mail

Quote:
Originally Posted by Shadow Wizard
sure Lestat, here is the correct syntax for this:
Code:
Set objUpload=New ShadowUpload

If objUpload.FileCount>0 Then
	Call objUpload.File(0).SaveToDisk(Server.MapPath("Uploads"), "")
End If

'changing all Request.Form to objUpload
If Trim(objUpload("Submit")) <> "" Then
	Set myMail = CreateObject("CDO.Message")
	myMail.Subject = Trim(objUpload("txtSubject"))
	myMail.From = Trim(objUpload("txtEmail"))
	myMail.To = "kevinloh@jobswalk.com"
	myMail.TextBody = Trim(objUpload("txtCoverLetter"))
	
	If objUpload.FileCount>0 Then
		myMail.AddAttachment Server.MapPath("Uploads") & "\" & objUpload.File(0).FileName
	End If
	
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
	myMail.Configuration.Fields.Update
	myMail.Send
	Set myMail = nothing
End If

changes are marked in bold, I've also added code that will attach
only if any file has been uploaded, to avoid errors.


Dear Shadow Wizard,
Thank you so much for your assistance. Managed to get the script to finally work. Apparently after inputing the above code the same error still persist.

If objUpload.FileCount>0 Then
myMail.AddAttachment Server.MapPath("Uploads") & "\" & objUpload.File(0).FileName
End If

But after adding a TRIM() surrounding the Trim(objUpload.File(0).FileName), everything was fine. Apparently there were some spaces in the textfield eventhough I didn't leave any.

Lastly, once I got the e-mail sent out, how do I delete the attachment from my Uploads folder as I do not want to keep the uploads file after I have finished e-mailing to the appropriate party. Your kindly wisdom is needed here.

Thanks a million.

Lestat

Reply With Quote
  #12  
Old December 26th, 2006, 10:47 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
try deleting it right after you Send your email:
Code:
If objUpload.FileCount>0 Then
		myMail.AddAttachment Server.MapPath("Uploads") & "\" & Trim(objUpload.File(0).FileName)
	End If
	
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 2
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "202.75.48.50"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 25
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = 1
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "mail@jobswalk.com"
	myMail.Configuration.Fields.Item("(URL address blocked: See forum rules)") = "abc123"
	myMail.Configuration.Fields.Update
	myMail.Send
	Set myMail = nothing
	
	If objUpload.FileCount>0 Then
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		objFSO.DeleteFile(Server.MapPath("Uploads") & "\" & Trim(objUpload.File(0).FileName))
		Set objFSO = Nothing
	End If

Reply With Quote
  #13  
Old August 30th, 2007, 06:18 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 51 m 24 sec
Reputation Power: 110
Hi!
I want to do the same thing,but my page is written in javascript.I try to include Shadowuploader in the page,but I don't think I'm doing it in the right way:

<%@ Language = JavaScript %>
<!-- #include file="ShadowUploader.asp" -->
<%
.
.
.
.
<script type="text/vbscript">
Dim objUpload
If Request("action")="1" Then
Set objUpload=New ShadowUpload
If objUpload.GetError<>"" Then
Response.Write("sorry, could not upload: "&objUpload.GetError)
.
.
.
.
</script>

Reply With Quote
  #14  
Old August 30th, 2007, 09:18 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 48th Plane (28500 - 28999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 28,838 Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2Folding Points: 549372 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 1 Day 14 h 30 m 10 sec
Reputation Power: 2389
my code is ASP and can't be used with client side JavaScript.
learn the basics of ASP, good website to start is w3schools.com and
when you gain some basic skills try using the upload script without email.
when you have this working let me know and I can help you write the
code to email the uploaded file.

Reply With Quote
  #15  
Old August 30th, 2007, 11:43 AM
b00gieman's Avatar
b00gieman b00gieman is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Location: Europe
Posts: 232 b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level)b00gieman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 11 h 51 m 24 sec
Reputation Power: 110
I figured out another way to use your upload script....but anyway,thanks...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Shadow Uploader - Email the uploaded file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek