ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

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 October 20th, 2006, 09:27 AM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Smile

(regarding this thread: http://forums.aspfree.com/code-bank...ures-94647.html)

Good Morning (Brazil) Dudes, Shadow ^^...

Your script work so flawless here in my tests... and it will be good to using it as a part of my form... but that is the question... i read others posts related to 'upload file', 'upload image' and about your shadowuploader but could not find any information about that:

I already have a form with and action (it is a asp who process the form data, send to database, send and e-mail, and etc...) so i need to add the upload possibility... but how can i do this if the upload process need this:

Code:
form action="<%=Request.ServerVariables( "Script_Name" )%>?action=1"


cause i already has a form action in my form.

I tried http://www.asp101.com/articles/jacob/scriptupload.asp and I canīt implement this in my application for the same reason...

So thereīs a way to manage this situation o put your upload as a piece of puzzle inside my puzzle?

Thanks dude, I think this could help others in a situation similar as mine...

Last edited by Shadow Wizard : October 24th, 2006 at 10:12 AM.

Reply With Quote
  #2  
Old October 20th, 2006, 09:47 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
keep the current form action, just add the needed attribute to the form HTML
and have the upload code in the target page.
for example if this is your current form:
Code:
<form action="page2.asp">

it should now look like this:
Code:
<form action="page2.asp" enctype="multipart/form-data" method="POST">

and in page2.asp you have to make the following changes:
  1. add this line:
    Code:
    <!-- #include file="ShadowUploader.asp" -->
  2. have this code on top of the page:
    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
  3. replace all Request("something") with objUpload("something")
that's all - the rest of the code should work just fine.

Reply With Quote
  #3  
Old October 23rd, 2006, 12:14 PM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Thanks Shadow... it works so flawless...

I have 2 questions about the image filename inserted in the database (itīs grabbing the full path... and i wanna only the filename) and after change this:

Code:
objMail.Attachfile "D:\inetpub\wwwroot\suporte\html\xtras\00fullwindow  \anexo.jpg"


to get the file uploaded...

gonna search around and if i found a way i will post here, for future search for others who might wanna the samething.

Thanks again.

Reply With Quote
  #4  
Old October 23rd, 2006, 12:37 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
I'm not sure I understand what you mean, please post here the code
you're using and I'll try to see..

Reply With Quote
  #5  
Old October 23rd, 2006, 02:15 PM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Hi Shadow : )

About my last post in this thread:

The scripts do the upload and put the path+file+extension in the database (ie: c:\dir1\dir2\file.jpg) itīs normal, 'cause the file browser component put this on the text area and so all the path goes to the database... I would like to put only the file name... so instead of the full path only file.jpg will go to the database. I have the database thing work ok (thanks to you too ).

In another part of the form i send a mail with a file attached, today i send a file with the same name and extension like this:

Code:
objMail.Attachfile "D:\inetpub\wwwroot\suporte\html\xtras\00fullwindow  \anexo.jpg"


this work normal...But will be cool if the form grabs the image filename from the database (just uploaded) and attach it to the form, something like that:

varfilename= "GrabTheNameFromTheDatabase"
dir="D:\inetpub\wwwroot\suporte\html\xtras\00fullwindow \"


so the objMail.Attachfile will be

objMail.Attachfile "dir+GrabTheNameFromTheDatabase"

Ok, worse example... but i think this can make things clear...
i was away but will go back to search in foruns about this...

thanks for the help Shadow.

[edit]
Ok, this helps me a lot:

http://forums.aspfree.com/showpost.php?p=365157&postcount=6

So now the image is getting a variable value and keeping the extension in file... so if i upload hahah.jpg and my assing variable has the 0001 value the file will be 0001.jpg. This is great \o\, but the database field still getting the fullpath+originalfilename+extension. Almost there: Find a way to grab the value "0001.jpg" instead of the fullpath+originalfilename+extension and put in the database.
[/edit]

Last edited by Khrysller : October 24th, 2006 at 09:43 AM.

Reply With Quote
  #6  
Old October 23rd, 2006, 03:43 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
ok, to extract file name only have this:
Code:
strFileName = Mid(strFullPath, InStrRev(strFullPath, "\")+1, Len(strFullPath))

use the same variable later when sending email.

Reply With Quote
  #7  
Old October 24th, 2006, 09:46 AM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Thumbs up

Hi Shadow, morning: )

I was thinking in a way like that:

I have this piece of code:

Code:
file1 = objUpload("chave")


it sends '0001' to the database... if I add .jpg to the variable 'chave' and than send it to database, will work... i am trying to do something like that:

file1 = objUpload("chave")+".jpg"

but it doesnīt work... could this be done in this way?

Thanks again dude...

Reply With Quote
  #8  
Old October 24th, 2006, 10:15 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
I have no idea what is "chave" - is this the name of the file control?

Reply With Quote
  #9  
Old October 24th, 2006, 11:48 AM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Quote:
Originally Posted by Shadow Wizard
I have no idea what is "chave" - is this the name of the file control?


itīs the input type text name from the form... : )

(i should ask this in a new post..., i think...
it will help-me with shadowuploader but itīs common for others tasks)

So i was thinking in do something like this:

one variable has a value: .jpg
another variable has another value: 0001

how to put the values together, so the result will be: 0001.jpg?

thanks in advance.

Last edited by Khrysller : October 24th, 2006 at 11:52 AM.

Reply With Quote
  #10  
Old October 25th, 2006, 01:00 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
you mean the user will choose the name for the file??
if so, this would work fine:
Code:
strFileName = objUpload("chave1") & objUpload("chave2")
Comments on this post
Khrysller agrees: thanks man ^^

Reply With Quote
  #11  
Old October 25th, 2006, 07:10 AM
Khrysller Khrysller is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 330 Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level)Khrysller User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
Quote:
Originally Posted by Shadow Wizard
you mean the user will choose the name for the file??
if so, this would work fine:
Code:
strFileName = objUpload("chave1") & objUpload("chave2")


Thanks SW, cool... thanks a lot...
i just got 1 thing to go... gonna search for a solution.

many many thanks

Reply With Quote
  #12  
Old July 10th, 2007, 09:07 AM
bubble bubble is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 60 bubble User rank is Private First Class (20 - 50 Reputation Level)bubble User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 55 m 58 sec
Reputation Power: 5
Quote:
Originally Posted by Shadow Wizard
keep the current form action, just add the needed attribute to the form HTML
and have the upload code in the target page.
for example if this is your current form:
Code:
<form action="page2.asp">

it should now look like this:
Code:
<form action="page2.asp" enctype="multipart/form-data" method="POST">

and in page2.asp you have to make the following changes:
  1. add this line:
    Code:
    <!-- #include file="ShadowUploader.asp" -->
  2. have this code on top of the page:
    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
  3. replace all Request("something") with objUpload("something")
that's all - the rest of the code should work just fine.


i try it but error.
this is my script....

this the html...
-----------------
<form action="addphoto.asp?action=1" enctype="multipart/form-data" method="post">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td colspan="2" align="left" class="headerabuabu">Upload Photo ~ Max 10 Photo/Album</td>
</tr>
<tr>
<td width="100" align="left" class="headerabuabu">Photo</td>
<td align="left" class="headerabuabu">:
<input type="file" name="file1" />
<input name="namaalbum" type="hidden" id="namaalbum" size="40" maxlength="50" value="<% response.Write aid %>" /></td>
</tr>
<tr>
<td align="left" class="headerabuabu">Comment</td>
<td align="left" class="headerabuabu">:
<textarea name="comment" cols="40" rows="4" id="comment"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td align="left"><label>
<input name="button" type="submit" class="headerabuabu" id="button" value="Submit" />
</label></td>
</tr>
</table>
</form>

----------------------
and this the script
-------------------

<!--#include file="tanggal.asp"-->
<!--#include file="bubble2.asp"-->
<!-- #include file="ShadowUploader.asp" -->
<%
Dim objUpload
If Request("action")="1" Then
Set objUpload=New ShadowUpload
If objUpload.GetError<>"" Then
Response.Write("sorry, could not upload: "&objUpload.GetError)
Else If (objUpload.File(x).ImageWidth>1024) Or (objUpload.File(x).ImageHeight>768) Then
Response.Write("image to big, not saving!")
Else
Call objUpload.File(x).SaveToDisk(Server.MapPath("images/album"), "ciayoo" & namafile(now) & objUpload.File(x).FileName)
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM foto"
rs.Open SQL, Conn, 1, 3
rs.AddNew
rs.Fields("userid") = "testing"
rs.Fields("ft_comment") = objUpload.comment
rs.Fields("ft_dir") = "testing" & namafile(now) & objUpload.File(x).FileName)
rs.Fields("tgl_mod") = now()
rs.Update
response.Redirect "myphoto.asp"
End If
End If
End If
%>

i need to upload and read to database, but using 2 pages(the script and form in different pages)
thx

Reply With Quote
  #13  
Old July 10th, 2007, 09:10 AM
BLarche BLarche is offline
Contributing User
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Jan 2007
Location: Indianapolis, USA
Posts: 3,551 BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level)BLarche User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 19 h 39 m 17 sec
Reputation Power: 695
Use Code Tags.

I try, but it error? What is the error?

Reply With Quote
  #14  
Old July 10th, 2007, 09:12 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
after you add code tags, also post full error message you're getting.
if it's not related to this thread, start new thread.

Reply With Quote
  #15  
Old July 10th, 2007, 09:17 AM
bubble bubble is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 60 bubble User rank is Private First Class (20 - 50 Reputation Level)bubble User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 18 h 55 m 58 sec
Reputation Power: 5
can you give me a sample code which form page and script page using the diffrent pages
thx

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > ShadowUploader - integrating the upload with existing code


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

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



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap