ShadowUploader - integrating the upload with existing code
Discuss ShadowUploader - integrating the upload with existing code in the ASP Development forum on ASP Free. ShadowUploader - integrating the upload with existing code ASP Development forum discussing ASP related topics including coding practices, ASP tips, and more. Active Server Pages (ASP) enables you to empower your HTML pages dynamically with robust scripting options.
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!
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.
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.
Posts: 31,109
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:
Posts: 330
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:
Posts: 330
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:
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:
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.
Posts: 330
Time spent in forums: 4 Days 13 h 41 sec
Reputation Power: 38
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?
Posts: 60
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:
----------------------
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