I am trying to set defaults so that when a user uploads a picture it will only display a certain size. Is there a way to do this?
Thanks
Greg BArnes
I found where you can dictate the size of the pics but when I try to upload to a file insteadof the database I get an error
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/properties/uploader.asp, line 39
I have attached the code so dont laugh when you read it... the folder name is Images.
<%@ Language=VBScript %>
<link REL="stylesheet" href="include/style.css" type="text/css">
<!--#INCLUDE FILE="include/clsUpload.asp"-->
<!--#include file="include/Properties_dbconnection.asp"-->
<!--#include file="include/Properties_aspfunctions.asp"-->
<!--#include file="include/Properties_variables.asp"-->
<%
Dim objUpload
Dim strFileName
Dim objConn
Dim objRs
Dim lngFileID
strTable = Request.QueryString("pictable")
strField = Request.QueryString("picfield")
sWhere = Request.QueryString("where")
strPK = Request.QueryString("PK")
strBack = Request.QueryString("Back")
if strBack="" then
strBack=1
else
strBack = CStr(CLng(strBack)+1)
end if
if Request.TotalBytes>0 then
' Instantiate Upload Class
Set objUpload = New clsUpload
' Grab the file name
strFileName = objUpload.Fields("File1").FileName
objUpload("File1").SaveAs(Server.MapPath("/Images/") & "\" & objUpload("File1").FileName)
objConn.Open strConnection
objRs.Open "SELECT " & strPK & ", " & AddWrappers(strField) & " FROM " & AddWrappers(strTable) & " WHERE " & sWhere, objConn, adOpenKeyset, adLockOptimistic
objRs.Fields(strField).AppendChunk objUpload("File1").BLOB & ChrB(0)
objRs.Update
objRs.Close
Set objRs = Nothing
Set objConn = Nothing
Set objUpload = Nothing
Response.Write "File has been saved in database<BR><BR>"
end if
%>
<a href="#" onclick="history.go(-<%=strBack%>);return false;">Back to editing</a>
<img src="imager.asp?pictable=<%=HTMLEncode(strTable)%>&picfield=<%=HTMLEncode(AddWrappers(strField))%>&where=<%=HTMLEncode(sWhere)%>">
<FORM method="post" encType="multipart/form-data" action="uploader.asp?pictable=<%=HTMLEncode(strTable)%>&picfield=<%=HTMLEncode(strField)%>&where=<%=HTMLEncode(sWhere)%>&PK=<%=HTMLEncode(strPK)%>&Back=<%=HTMLEncode(strBack)%>">
<INPUT type="File" name="File1">
<INPUT type="Submit" value="Upload">
</FORM>