Forum Moderators: open

Message Too Old, No Replies

need pure asp upload script

upload script

         

pogamer

12:26 am on Sep 11, 2006 (gmt 0)

10+ Year Member



hi everyone, im a newby in asp.

is there a way to upload file in asp without installing any dll?

i really need this. anyone, please i need your help..

vite_rts

12:49 am on Sep 11, 2006 (gmt 0)

10+ Year Member



well all the methods I know require asp or asp.net code

furthermore, it also depends on what your host will permit and has already installed

if you're using classic asp, ask your host if they've got an asp upload application installed, a common one is aspupload

paulanthony

7:21 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



yep there is ways and means. Buy DWzone pure upload.

pogamer

11:31 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



thanks guys,

currently im using this script to upload file, by jacob gilley. it works well in my localhost, but the script halt on SaveToDisk when i upload it on ftp, i try to response.write the path, the path is correct where i should save the file.

///////////////////////////////////////////////////////////////
the script
////////////////////////////////////////////////////////////
<%
response.Buffer = true

if session("userfullname") = "" then
response.Redirect("admin-login.asp")
end if
%>
<!-- #include file="admin_upload.asp" -->
<!-- #include file="connect.asp" -->
<!-- #include file="functions.asp" -->

'create file uploader
dim Uploader, tFile
set Uploader = New FileUploader
' This starts the upload process
Uploader.Upload()
if not isobject(Uploader.form("Upload Image")) then
If Uploader.Files.Count > 0 Then
set fs = server.CreateObject("Scripting.FileSystemObject")

if Uploader.form("fieldUpdate") = "enlarge" then
mpath = "photos/large/"&Uploader.Files("uploadfile").FileName
elseif Uploader.form("fieldUpdate") = "linedraw" then
mpath = "photos/line_drawing/"&Uploader.Files("uploadfile").FileName
elseif Uploader.form("fieldUpdate") = "normal" then
mpath = "photos/normal/"&Uploader.Files("uploadfile").FileName
end if

if Uploader.Files("uploadfile").FileName = session("imgName") and (fs.FileExists(server.MapPath(mpath))=true) then
errmsg = "ERROR : Invalid image name. Image already exist, please rename your filename."
else
if Uploader.form("fieldUpdate") = "enlarge" then
path = "photos\large\"
sql2 = "update "&session("category")&" set enlarge_img='"&Uploader.Files("uploadfile").FileName&"' where prod_code='"&session("pcodeUpdate")&"'"
elseif Uploader.form("fieldUpdate") = "linedraw" then
path = "photos\line_drawing\"
sql2 = "update "&session("category")&" set line_draw='"&Uploader.Files("uploadfile").FileName&"' where prod_code='"&session("pcodeUpdate")&"'"
elseif Uploader.form("fieldUpdate") = "normal" then
path = "photos\normal\"
sql2 = "update "&session("category")&" set img_path='"&Uploader.Files("uploadfile").FileName&"' where prod_code='"&session("pcodeUpdate")&"'"
end if

Uploader.Files("uploadfile").SaveToDisk server.MapPath(path) & "\" '"e:\inetpub\esvc000798\conserv2006\photos\line_drawing\"

'conn.execute sql2

errmsg = "File succesfully uploaded."
end if

End if
End if

vite_rts

11:41 pm on Sep 11, 2006 (gmt 0)

10+ Year Member



do you understand what the script does, or do you just run it?

Reason I ask is that such a script needs details replaced that oyu must get from your isp,,,

an if you don't understand the script,,

pogamer

12:37 am on Sep 12, 2006 (gmt 0)

10+ Year Member



sorry about that but yes ive change/provided all the details that is needed, and i wonder why it works well with my localhost, but failed when i upload it.. is there something wrong with the script? i always get the error:: permission denied..

vite_rts

12:46 am on Sep 12, 2006 (gmt 0)

10+ Year Member



I assume that the script you 've posted is not exact, cos tha script couldldn't possibly run anywhere cos all the

<%
%> are incomplete for one thing, the includes are not at the top ,,

Anyway, you say it works on your local machine

Well that message suggests that your host hasn't given you permission to write to the folder in question, speak to them again an ask them about that

pogamer

12:56 am on Sep 12, 2006 (gmt 0)

10+ Year Member



thanks for that.. i talk to them..

aspdaddy

4:40 pm on Sep 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The answer is in your own post, there is a free script called "pure asp upload" :) Its not the fastest for large files but works fine for documents and small images. Been used for the last 5 years on a busy dating site for uploading images without any problems at all.

[asp101.com...]

pogamer

1:38 am on Sep 14, 2006 (gmt 0)

10+ Year Member



thanks again, the scripts now works fine, vite is right i need to talk to my host.

carguy84

3:34 am on Sep 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the includes are not at the top

Includes can go anywhere in an ASP file, fyi. Top, bottom, middle, it doesn't matter, the ASP engine just combines them all into one ASP file in memory at run time anyway.

Chip-