Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Upload Picture MOD (File Attachment)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Markp
New Member

54 Posts

Posted - 04 July 2001 :  16:00:48  Show Profile
This is an extension on another thread. Quite frankly was getting lost.

I have implemented the Mod. I have gone into the Admin section and set the files size to 50KB - and the file extensions. When I go to post a message, I do not see a way to upload the files.

I am using the uploadengine.asp that is for posting the images rather than setting a hyplerlink.

Thanks


Edited by - markp on 04 July 2001 16:21:33

Markp
New Member

54 Posts

Posted - 04 July 2001 :  17:59:19  Show Profile
One other thing, if I delete a post now, as Adim, I end up back at this forum, instead of returning to my own.

thanks


Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 04 July 2001 :  21:26:48  Show Profile
I guess everything is stored in your cache, Delete the cookies/cache and refresh the page. Try it



The way to upload files is simple.. Just next to the Mode : ( Basic ) below you will have something called Attach File : .... go ahead and click it

it will show if you have properly edited post.asp !!


Edited by - SalmanKhana on 04 July 2001 21:28:04
Go to Top of Page

Markp
New Member

54 Posts

Posted - 04 July 2001 :  22:21:38  Show Profile
No there isnt anything there, see for yourself. www.opforland.com/forum/default.asp

Go to Top of Page

Markp
New Member

54 Posts

Posted - 04 July 2001 :  22:49:10  Show Profile
I also went through all the code inserts again, I believe I have them all correct, you would imagine if I inserted them incorrectly I would experience some error.

Thanks for your help. I am probably missing some small thing but I can't imagine what.






Edited by - markp on 04 July 2001 22:50:29
Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 05 July 2001 :  01:22:09  Show Profile
Can you put up your UPloadEngine.asp please ?

Let me have a look at it.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 05 July 2001 :  06:15:13  Show Profile  Visit HuwR's Homepage
If you ar not getting the upload icon, then the app variabkes for allowing upploads have not been set, If yo have a file called MOD_CONFIG, check that the variables for attachment are uncommented

Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 05 July 2001 :  11:01:52  Show Profile
o yes.. huwR is right

you have to uncomment those 3 or 4 lines there !!

check it out dude .. i'll be back after my final.. i'm pretty scared though

Go to Top of Page

Markp
New Member

54 Posts

Posted - 05 July 2001 :  11:23:48  Show Profile
I ll check it now, you'll do fine just relax, breath deep, plenty of oxygen, best brain food there is.

Mark


Go to Top of Page

Markp
New Member

54 Posts

Posted - 05 July 2001 :  12:02:48  Show Profile
Ok missed the variable declaration, DUH!.

page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the www.opforland.com home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file 'config.asp' was not found.
/forum/Mods/UploadEngine.asp, line 41

This is waht I am getting now.

Go to Top of Page

Markp
New Member

54 Posts

Posted - 05 July 2001 :  12:05:54  Show Profile
current Uploadengine.asp loaction /forum/mod/uploadengine.asp

<%
'#################################################################################
'## Copyright (C) 2000 Michael Anderson and Pierre Gorissen
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'# File Attachment Mod by Huw Reddick
'#################################################################################
%>
<!--#include file="config.asp"-->
<!--#include file="inc_functions.asp"-->
<!-- #include file="include/clsUpload.inc" -->

<%
'--- Object to parse the input ---
Dim objUpload
Dim strRoot
Dim strFolder
Dim MaxFileSize
Dim boolAllowedType
Dim strAllowedExtensions
Dim strResult
Dim faname
Dim boolSuccess
Dim intFileLen
Dim ImageFile
Dim ServerTimeout

ServerTimeout = 10000

set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

Set objDict = Server.CreateObject("Scripting.Dictionary")
set objRec = my_Conn.execute("SELECT * FROM " & strTablePrefix & "MODS WHERE M_NAME = 'Attachment' OR M_CODE = 'Attachment'")

while not objRec.EOF
objDict.Add objRec.Fields.Item("m_code").Value, objRec.Fields.Item("m_value").Value
objRec.moveNext
wend

MaxFileSize = cLng(objDict.Item("faMaxSize"))*512
strAllowedExtensions = objDict.Item("faExtensions")
boolAllowUploads = cint(objDict.Item("Attachment"))

objRec.Close
set objDict = nothing
set my_Conn = nothing


strResult = "Finished..."

If Request.TotalBytes > 0 Then
Set objUpload = new clsUpload
objUpload.ParseRequest
If (objUpload.Files.Count = 1) Then
strFolder = objUpload.Form.Item("Folder")
TopicID = objUpload.Form.Item("TOPIC_ID")
ReplyID = objUpload.Form.Item("REPLY_ID")
ServerTimeout = objUpload.Form.Item("TimeOut")
if ReplyId = "" then
ReplyID = -1
end if
if TopicID = "" then
TopicID = -1
end if
MemberID = objUpload.Form.Item("MEMBER_ID")
faname = objUpload.Files.Item(0).FileName
boolAllowedType = Instr(strAllowedExtensions, Right(objUpload.Files.Item(0).FileName,4)) > 0
ImageFile = Instr(".jpg,.gif", Right(objUpload.Files.Item(0).FileName,4)) > 0
intFileLen = len(objUpload.Files.Item(0).Blob)
if intFileLen > MaxFileSize then
strResult = "File is too Large to upload"
else
if boolAllowedType then
Response.write "Uploading.... Please wait"
boolSuccess = saveDoc()
If boolSuccess = "True" Then
intoDB()

strResult = "The File " & objUpload.Files.Item(0).FileName & " was uploaded to the Server"
End If
else
strResult = "File Type Not Allowed"
end if
end if
Else
strResult = "No file to upload."
End If
End If


'---------------------------------------------------------------------------
'- Function : intoDB
'- Description : inserts the document information in the database
'---------------------------------------------------------------------------
Private Function intoDB()
Dim strSQL
set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
set rs= Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strMemberTablePrefix & "USERFILES (MEMBER_ID,F_FILENAME,F_FILESIZE,F_TOPIC_ID,F_REPLY_ID) VALUES("
strSQL = strSQL & MemberID & ", "
strSQL = strSQL & "'" & objUpload.Files.Item(0).FileName
strSQL = strSQL & "'," & intFileLen & ", "
strSQL = strSQL & TopicID & ", "
strSQL = strSQL & ReplyID & ")"
my_Conn.execute( strSQL )
strSQL = "SELECT F_FILEID FROM " & strMemberTablePrefix & "USERFILES WHERE MEMBER_ID=" & MemberID
strSQL = strSQL & " AND F_TOPIC_ID=" & TopicID & " AND F_REPLY_ID=" & ReplyID
if not ImageFile then
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, 3
faname = rs("F_FILEID")
rs.close
end if
my_conn.close
End Function

'---------------------------------------------------------------------------
'- Function : saveDoc
'---------------------------------------------------------------------------
private function saveDoc()

Dim strFile
Dim fso
server.scriptTimeout = cLng(ServerTimeout)
strRoot = Server.MapPath(strCookieURL & "uploaded") & GetSlash & strFolder
strFile = strRoot & GetSlash & objUpload.Files.Item(0).FileName
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If not fso.FolderExists(strRoot) then

fso.createFolder(strRoot)
end if
objUpload.Files.Item(0).Save strRoot
saveDoc = (fso.FileExists(strFile))
End Function

Function GetSlash
strAspOs = UCase(Request.ServerVariables("ASP_OS"))
If InStr(strAspOs,"WINDOWS") Then
GetSlash = "\"
Else
GetSlash = "/"
End If
end function

%>
<html>

<head>
<title><% =strForumTitle %></title>
<meta name="copyright" content="This code is Copyright (C) 2000 Michael Anderson">
<Style><!--
a:link {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
--></style>
</head>

<BODY bgColor="<% =strPageBGColor %>" text="<% =strDefaultFontColor %>" link="<% =strLinkColor %>" aLink=<% =strActiveLinkColor %> vLink="<% =strActiveLinkColor %>" onLoad="window.focus()">

<table width="100%" height="100%">
<tr>
<td align=center valign=center>
<div align=center><center>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">

<p> <%=strResult%></p><br><br>

<p>
<% if imageFile then %>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= addimage()">Close Window</A></font>
<% Else %>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= addfile()">Close Window</A></font>
<% End If %>
</p>
</font>
</center></div>
</td>
</tr>
</table>
<script language="JavaScript">
<!--
function addfile()
{
var fname, resultString
resultString ='<%= boolSuccess %>';
fname = '<%= faname %>';
if (resultString)
window.opener.document.PostTopic.Message.value+= 'download';
window.close();
}

//-->
</script>
<script language="JavaScript">
<!--
function addimage()
{
var fname, resultString
resultString ='<%= boolSuccess %>';
fname = '<%= faname %>';
if (resultString)
window.opener.document.PostTopic.Message.value+= '';
window.close();
}

//-->
</script>

</BODY>
</HTML>




Edited by - markp on 05 July 2001 12:07:24
Go to Top of Page

Markp
New Member

54 Posts

Posted - 05 July 2001 :  20:00:07  Show Profile
bump

Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 05 July 2001 :  22:25:11  Show Profile
copy this code in your uploadengine.asp

i can email it to u too


<%
'#################################################################################
'## Copyright (C) 2000 Michael Anderson and Pierre Gorissen
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'# File Attachment Mod by Huw Reddick
'#################################################################################
%>
<!--#include file="../config.asp"-->
<!--#include file="../inc_functions.asp"-->
<!-- #include file="../include/clsUpload.inc" -->

<%
'--- Object to parse the input ---
Dim objUpload
Dim strRoot
Dim strFolder
Dim MaxFileSize
Dim boolAllowedType
Dim strAllowedExtensions
Dim strResult
Dim faname
Dim boolSuccess
Dim intFileLen
Dim ImageFile
Dim ServerTimeout

ServerTimeout = 10000

set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

Set objDict = Server.CreateObject("Scripting.Dictionary")
set objRec = my_Conn.execute("SELECT * FROM " & strTablePrefix & "MODS WHERE M_NAME = 'Attachment' OR M_CODE = 'Attachment'")

while not objRec.EOF
objDict.Add objRec.Fields.Item("m_code").Value, objRec.Fields.Item("m_value").Value
objRec.moveNext
wend

MaxFileSize = cLng(objDict.Item("faMaxSize"))*512
strAllowedExtensions = objDict.Item("faExtensions")
boolAllowUploads = cint(objDict.Item("Attachment"))

objRec.Close
set objDict = nothing
set my_Conn = nothing


strResult = "Finished..."

If Request.TotalBytes > 0 Then
Set objUpload = new clsUpload
objUpload.ParseRequest
If (objUpload.Files.Count = 1) Then
strFolder = objUpload.Form.Item("Folder")
TopicID = objUpload.Form.Item("TOPIC_ID")
ReplyID = objUpload.Form.Item("REPLY_ID")
ServerTimeout = objUpload.Form.Item("TimeOut")
if ReplyId = "" then
ReplyID = -1
end if
if TopicID = "" then
TopicID = -1
end if
MemberID = objUpload.Form.Item("MEMBER_ID")
faname = objUpload.Files.Item(0).FileName
boolAllowedType = Instr(strAllowedExtensions, Right(objUpload.Files.Item(0).FileName,4)) > 0
ImageFile = Instr(".jpg,.gif", Right(objUpload.Files.Item(0).FileName,4)) > 0
intFileLen = len(objUpload.Files.Item(0).Blob)
if intFileLen > MaxFileSize then
strResult = "File is too Large to upload"
else
if boolAllowedType then
Response.write "Uploading.... Please wait"
boolSuccess = saveDoc()
If boolSuccess = "True" Then
intoDB()

strResult = "The File " & objUpload.Files.Item(0).FileName & " was uploaded to the Server"
End If
else
strResult = "File Type Not Allowed"
end if
end if
Else
strResult = "No file to upload."
End If
End If


'---------------------------------------------------------------------------
'- Function : intoDB
'- Description : inserts the document information in the database
'---------------------------------------------------------------------------
Private Function intoDB()
Dim strSQL
set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
set rs= Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strMemberTablePrefix & "USERFILES (MEMBER_ID,F_FILENAME,F_FILESIZE,F_TOPIC_ID,F_REPLY_ID) VALUES("
strSQL = strSQL & MemberID & ", "
strSQL = strSQL & "'" & objUpload.Files.Item(0).FileName
strSQL = strSQL & "'," & intFileLen & ", "
strSQL = strSQL & TopicID & ", "
strSQL = strSQL & ReplyID & ")"
my_Conn.execute( strSQL )
strSQL = "SELECT F_FILEID FROM " & strMemberTablePrefix & "USERFILES WHERE MEMBER_ID=" & MemberID
strSQL = strSQL & " AND F_TOPIC_ID=" & TopicID & " AND F_REPLY_ID=" & ReplyID
if not ImageFile then
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, 3
faname = rs("F_FILEID")
rs.close
end if
my_conn.close
End Function

'---------------------------------------------------------------------------
'- Function : saveDoc
'---------------------------------------------------------------------------
private function saveDoc()

Dim strFile
Dim fso
server.scriptTimeout = cLng(ServerTimeout)
strRoot = Server.MapPath(strCookieURL & "../uploaded") & GetSlash & strFolder
strFile = strRoot & GetSlash & objUpload.Files.Item(0).FileName
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If not fso.FolderExists(strRoot) then

fso.createFolder(strRoot)
end if
objUpload.Files.Item(0).Save strRoot
saveDoc = (fso.FileExists(strFile))
End Function

Function GetSlash
strAspOs = UCase(Request.ServerVariables("ASP_OS"))
If InStr(strAspOs,"WINDOWS") Then
GetSlash = "\"
Else
GetSlash = "/"
End If
end function

%>
<html>

<head>
<title><% =strForumTitle %></title>
<meta name="copyright" content="This code is Copyright (C) 2000 Michael Anderson">
<Style><!--
a:link {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
--></style>
</head>

<BODY bgColor="<% =strPageBGColor %>" text="<% =strDefaultFontColor %>" link="<% =strLinkColor %>" aLink=<% =strActiveLinkColor %> vLink="<% =strActiveLinkColor %>" onLoad="window.focus()">

<table width="100%" height="100%">
<tr>
<td align=center valign=center>
<div align=center><center>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">

<p> <%=strResult%></p><br><br>

<p>
<% if imageFile then %>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= addimage()">Close Window</A></font>
<% Else %>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= addfile()">Close Window</A></font>
<% End If %>
</p>
</font>
</center></div>
</td>
</tr>
</table>
<script language="JavaScript">
<!--
function addfile()
{
var fname, resultString
resultString ='<%= boolSuccess %>';
fname = '<%= faname %>';
if (resultString)
window.opener.document.PostTopic.Message.value+= 'download';
window.close();
}

//-->
</script>
<script language="JavaScript">
<!--
function addimage()
{
var fname, resultString
resultString ='<%= boolSuccess %>';
fname = '<%= faname %>';
if (resultString)
window.opener.document.PostTopic.Message.value+= '';
window.close();
}

//-->
</script>

</BODY>
</HTML>




Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 05 July 2001 :  22:27:49  Show Profile
dude try that out.. it should work.. every1 else i gave that had no problems with it...

if it doesn't work .. get back here or i'll reply to ur email tomorrow cuz i just finished a final and tomorrow i have 2 more final exams to take and one project

so catch ya later !!

Go to Top of Page

Markp
New Member

54 Posts

Posted - 05 July 2001 :  23:07:39  Show Profile
please email me, I am picking up a bunch of weird charactors when I try and copy and past.

markp@saludmejor.com



Go to Top of Page

SalmanKhana
Average Member

USA
961 Posts

Posted - 06 July 2001 :  01:39:29  Show Profile
i've emailed you.. it worked with the other guyz who had problems...... let us know if it works with u too .. i'm sure it will !!

Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.46 seconds. Powered By: Snitz Forums 2000 Version 3.4.07