Page 4 of 9 First ... 23456 ... Last
  • Jump to page:
    #46
  1. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    11
    i found another thread about the problem im having, but it never got resolved..

    Im just trying to send an email with some form data in it when the file gets uploaded and am getting this error...

    Microsoft VBScript runtime error '800a01a8'

    Object required: 'm_Request'

    /cm/Galleries/ShadowUploader.asp, line 29


    Code:
    <%
    Dim objUpload
    Set objUpload = New ShadowUpload
    If Request("action")="1" Then
    	Set objUpload=New ShadowUpload
    	If objUpload.GetError<>"" Then
    		Response.Write("Sorry, could not upload: "&objUpload.GetError)
    	Else  
    		Response.Write("Found "&objUpload.FileCount&" Files...<br />")
    		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 />")
    			Response.Write("Image width: "&objUpload.File(x).ImageWidth&"<br />")
    			Response.Write("Image height: "&objUpload.File(x).ImageHeight&"<br />")
    			If (objUpload.File(x).ImageWidth>2000) Or (objUpload.File(x).ImageHeight>2000) Then
    				Response.Write("Image to big, not saving!")
    			Else  
    				Call objUpload.File(x).SaveToDisk(Server.MapPath("../Uploads"), "")
    				Response.Write("File saved successfully!")
    			End If
    			Response.Write("<p>")
    		Next
    		Response.Write("Thank you. Your image is now being processed "&objUpload("strname"))
    	End If
    End If
    
    Const cdoSendUsingMethod = _
    "http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSendUsingPort = 2
    Const cdoSMTPServer = _
    "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort = _
    "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout = _
    "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    Const cdoSMTPAuthenticate = _
    "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    Const cdoBasic = 1
    Const cdoSendUserName = _
    "http://schemas.microsoft.com/cdo/configuration/sendusername"
    Const cdoSendPassword = _
    "http://schemas.microsoft.com/cdo/configuration/sendpassword"
    
    Dim objConfig ' As CDO.Configuration
    Dim objMessage ' As CDO.Message
    Dim Fields ' As ADODB.Fields
    
    ' Get a handle on the config object and it's fields
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    ' Set config fields we care about
    With Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "mail.djrclub17.com.au"
    .Item(cdoSMTPServerPort) = 25
    .Item(cdoSMTPConnectionTimeout) = 10
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSendUserName) = "msilk@djrclub17.com.au"
    .Item(cdoSendPassword) = "fattestt"
    
    .Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    
    Set objMessage.Configuration = objConfig
    
    With objMessage
    .To = "msilk@djrclub17.com.au"
    .From = "Club17 Gallery"
    .Subject = "Image Uploaded"
    .TextBody = "" & objUpload("strname")
    .Send
    End With
    
    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing
    %> 
    			 
    <form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1" enctype="multipart/form-data" method="POST">
      <table width="448" border="0" cellpadding="0" cellspacing="0" background="../images/grey_bg.gif" bgcolor="#F2F2F2">
    	<tr bgcolor="#F2F2F2">
    	  <td colspan="6"><img src="../images/tran.gif" width="13" height="13"></td>
    	</tr>
    	<tr bgcolor="#F2F2F2">
    	  <td width="13" rowspan="4" align="left" valign="top"><img src="../images/tran.gif" width="13" height="13"></td>
    	  <td height="14" colspan="4" valign="top">Want to <span class="fontblack">Submit An Image</span> to one of our<span class="fontblack"> Fan Galleries</span>? Do it here. </td>
    	  <td width="13" rowspan="4" align="right" valign="top"><img src="../images/tran.gif" width="13" height="13"></td>
    	</tr>
    	<tr bgcolor="#F2F2F2">
    	  <td colspan="4"><img src="../images/tran.gif" width="180" height="8"></td>
    	</tr>
    	<tr bgcolor="#F2F2F2">
    	  <td colspan="2" class="fontblack">Your Name: </td>
    	  <td width="230" class="fontblack">Your Image: </td>
    	  <td width="41">&nbsp;</td>
    	  </tr>
    	<tr>
    	  <td width="147"><input name="strname" type="text" id="name"></td>
    	  <td width="4">&nbsp;</td>
    	  <td><input name="file1" type="file" /></td>
    	  <td align="left">
    		<div align="left">
    		  <input name="submit" type=IMAGE id="submit2" src="../images/send_image.gif" width="41" height="17">
    		</div></td>
    	</tr>
    	<tr bgcolor="#F2F2F2">
    	  <td colspan="6"><img src="../images/tran.gif" width="13" height="13"></td>
    	</tr>
      </table>
    	  </form>
  2. #47
  3. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    don't call this line twice:
    Code:
    Set objUpload = New ShadowUpload
    this is mistake.

    you get error because you're using the upload object before
    you clicked the submit button: you don't have any data yet -
    another basic mistake in the logic.

    you can use the upload component only after you have data
    i.e. only after clicking the submit button, that's why I have
    such line in the code:
    Code:
    If Request("action")="1" Then
    it's not just for fun, it's there for good reason.
    you have to put all the code inside that If..Then block.
  4. #48
  5. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    11
    I understand that i must be very frustrating to you. But I do not pretend to know what im doing... i am a complete novice when it comes to this stuff and i just need it done.

    I was asked to build this website for this Supporters Club with what little knowledge i have, and im doing my best...

    If you could just tell me exactly what i need to know to make this code work i will be very grateful, and i'll get out of your hair.

    I am not a programmer, im an electrician...

    I removed the second instance of that line, and still get the same error.. What exactly do you mean by 'place the code inside the 'if...then' block because when i did that it gave me an 'Expected Then' error

    Code:
          </form>
    	  <%
    Dim objUpload
    Set objUpload=New ShadowUpload
    If Request("action")="1" Then
    	If objUpload.GetError<>"" Then
    		Response.Write("Sorry, could not upload: "&objUpload.GetError)
    	Else  
    		Response.Write("Found "&objUpload.FileCount&" Files...<br />")
    		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 />")
    			Response.Write("Image width: "&objUpload.File(x).ImageWidth&"<br />")
    			Response.Write("Image height: "&objUpload.File(x).ImageHeight&"<br />")
    			If (objUpload.File(x).ImageWidth>2000) Or (objUpload.File(x).ImageHeight>2000) Then
    				Response.Write("Image to big, not saving!")
    			Else  
    				Call objUpload.File(x).SaveToDisk(Server.MapPath("../Uploads"), "")
    				Response.Write("File saved successfully!")
    			End If
    			Response.Write("<p>")
    		Next
    		Response.Write("Thank you. Your image is now being processed "&objUpload("strname"))
    	End If
    End If
    %>
    <%
    Const cdoSendUsingMethod = _
    "http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSendUsingPort = 2
    Const cdoSMTPServer = _
    "http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort = _
    "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout = _
    "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    Const cdoSMTPAuthenticate = _
    "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
    Const cdoBasic = 1
    Const cdoSendUserName = _
    "http://schemas.microsoft.com/cdo/configuration/sendusername"
    Const cdoSendPassword = _
    "http://schemas.microsoft.com/cdo/configuration/sendpassword"
    
    Dim objConfig ' As CDO.Configuration
    Dim objMessage ' As CDO.Message
    Dim Fields ' As ADODB.Fields
    
    ' Get a handle on the config object and it's fields
    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields
    
    ' Set config fields we care about
    With Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = "mail.djrclub17.com.au"
    .Item(cdoSMTPServerPort) = 25
    .Item(cdoSMTPConnectionTimeout) = 10
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSendUserName) = "msilk@djrclub17.com.au"
    .Item(cdoSendPassword) = "fattestt"
    
    .Update
    End With
    
    Set objMessage = Server.CreateObject("CDO.Message")
    
    Set objMessage.Configuration = objConfig
    
    With objMessage
    .To = "msilk@djrclub17.com.au"
    .From = "Club17 Gallery"
    .Subject = "Image Uploaded"
    .TextBody = "an image has been uploaded" &objUpload("strname")
    .Send
    End With
    
    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing
    %>
  6. #49
  7. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by Silky
    I am not a programmer, im an electrician...
    so may I politely ask what are you doing here?
    when I need to fix my car, I pay to someone that will fix it for me.
    I won't start messing with it when I know nothing - it's waste of
    time and of effort.
    if you're not programmer, you need to hire one that will do the
    programming for you.. sorry for wasting your time.

    you need complete code, guidance won't help in your case.
  8. #50
  9. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    11
    ... because this forum is called 'ASP Free forum' where you come for help with ASP. It doesnt say anywhere you have to be an expert programmer to have a go.

    We obviously have different ways of looking at things, because i will always try and do something for myself before i go off and pay for someone else to do it.

    Im not trying to say that im a master. I know i'm not, but i built this entire website... and im pretty damn proud of it. It looks good, it works good, and i have 100's of contributing members that support me all the way.

    Im not very good at asp code by your standards, but i'm no dummy. There are some things i can figure out, and some things i cant. I'm asking you a favour. You wouldnt help me with your own email component for your upload code, so i went and tried to find another, and ive ALMOST got it to work the way i want it to. It sends an email when the image is uploaded, and all i want it to do is email me the data from the 'strname' field along with the little message.

    Its very frustrating because i know you know how to do it. All you'd have to do is alter my code a little bit and it would be done and i'd leave you alone, but instead you choose to be difficult and treat me like im an idiot.

    Not trying to start an argument. I dont know you. But that's how i feel.
  10. #51
  11. Space Surfing Wizard
    ASP Genius (4000 - 4499 posts)

    Join Date
    Apr 2007
    Location
    In Space Else Where??
    Posts
    4,113
    Rep Power
    1964
    We here at Aspfree are there to help people learn not alter and give back their code Shadow is one of the best here and he was trying to Help you and so are others over here when u don't know something u should politely ask that's how work is done We all over here were novice at sometimes.You know asp but some people here seldom know it then too they try to learn and if u can't be polite then u will never succeed in Aspfree Thanks for Reading if u need to learn it here are some links

    http://www.w3schools.com
    Hope u understand what i am trying to explain
  12. #52
  13. No Profile Picture
    Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    11
    I understand, i have a thread in the asp section where, if you go over it, you'll see that in normal circumstances i would try and learn... But as i stated in that thread, and in this one, The site was launched yesterday and i went back to work today... and i just wanted it to work.

    I have never had any formal training from anyone. Everything i know, i learned from reading these forums, and googling... i understand the benefits of learning things yourself...

    anyway. Ive written on the site now that people need to rename there image files so that i know who theyre from. Ive given up on it, so it doesnt matter now.

    Im using Shadow's script as a way for people to send me their images files for a fan gallery we have on the site.

    http://www.djrclub17.com.au/
    Last edited by Silky; January 2nd, 2008 at 05:04 AM.
  14. #53
  15. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    I do understand you Silky and I tried to help as best I could, but you
    just failed to understand trivial concepts.
    you never posted reply to my last question in your other thread, if at
    some point in the future you'll want it done feel free to read my last
    reply then and answer it.
    I'm trying to avoid writing everything for you, because I've learned in
    the hard way that 99% of the times it's useless and waste of my time:
    people who are looking for "code favor" will keep doing this forever and
    will never truly learn or become programmers.
    the only way to learn is do things yourself.
  16. #54
  17. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    May 2006
    Location
    Delhi-India
    Posts
    231
    Rep Power
    35
    Silky's point is very wrong. Ofcourse it is a free forum, but we should always use it like a forum. We make our pages, and in case of stuck with a problem in script, we share our code and get helped.
    Noone treats here anybody like an idiot. In my eyes, the forum has always been friendly and shadow wizard is The Best.
  18. #55
  19. No Profile Picture
    Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Feb 2005
    Posts
    151
    Rep Power
    31
    What's the maximum file size for this script? I would like to be able to upload video files to an internal server...maybe 600 MB or so? Can this script support that? Thanks!
  20. #56
  21. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    in theory there is no maximum file size, just make sure to change the
    constant in my code and to increase the Script Time Out.
  22. #57
  23. Expert Learner
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Feb 2005
    Location
    Wisconsin
    Posts
    1,909
    Rep Power
    101
    Random factoid:

    When verifying a file's type, you should really validate the mime-type using the ContentType property rather than the file extension.

    Code:
    If objUpload.File(i).ContentType <> "text/html" Then
         Response.Write("uh oh.  I was looking for a HTML file and you uploaded something else!")
    End If

    Comments on this post

    • Shadow Wizard agrees : thanks :)
  24. #58
  25. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    hi Shadow,

    i'm just new here, with a problem that i can't solve...

    the problem is, why i can't open any picture (jpeg, gif, png) after i uploaded to Uploads directory? the preview software show me that the it is a unsupported image type.

    what should i do?

    THX a lot!!!
  26. #59
  27. Moderator From Beyond
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2004
    Location
    Israel
    Posts
    31,135
    Rep Power
    2925
    Originally Posted by TriVector
    hi Shadow,

    i'm just new here, with a problem that i can't solve...

    the problem is, why i can't open any picture (jpeg, gif, png) after i uploaded to Uploads directory? the preview software show me that the it is a unsupported image type.

    what should i do?

    THX a lot!!!
    can you post an example?
    (link to picture that after upload get corrupted)
  28. #60
  29. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2008
    Posts
    5
    Rep Power
    0
    h t t p : / / w w w . chinaklang . com/Down/td_act_bottom.gif

    THX (must delete the blanks....)
Page 4 of 9 First ... 23456 ... Last
  • Jump to page:

Similar Threads

  1. Upload Script with HTTPget
    By comix2000 in forum ASP Development
    Replies: 1
    Last Post: January 20th, 2005, 06:50 PM
  2. Hot Or Not Script Upload Error
    By marya in forum ASP Development
    Replies: 5
    Last Post: October 14th, 2004, 08:12 PM
  3. Huge / Pure upload?
    By fatmanman in forum ASP Development
    Replies: 0
    Last Post: September 14th, 2004, 06:20 AM
  4. Replies: 2
    Last Post: August 27th, 2004, 03:58 PM
  5. Upload script
    By kutty in forum ASP Development
    Replies: 0
    Last Post: October 1st, 2003, 03:36 PM

IMN logo majestic logo threadwatch logo seochat tools logo