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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Mike's File Attachment Mod for Snitz
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 15

Etymon
Advanced Member

United States
2385 Posts

Posted - 20 August 2002 :  18:30:12  Show Profile  Visit Etymon's Homepage

I don't have v3.4 either. Would like to hear if your MOD works though.
Go to Top of Page

simonettaj
Starting Member

Australia
5 Posts

Posted - 22 August 2002 :  00:51:56  Show Profile
Mike's File Attachment mod is not easy to install on snitz3.4 as all the response.writes make it hard to integrate the code, as the instructions in the readme file don’t apply anymore given all the differences in the way 3.4 works to older versions.

I have tried numerous times only to fail. Could someone help me work out where to add the bit of code that will display the link to attach files using mike's added files?

Also point me to HuwR completed upload mod for 3.4 can't seem to find it?
Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 22 August 2002 :  01:36:04  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
Also point me to HuwR completed upload mod for 3.4 can't seem to find it?


Although completed, I don't think HUWR has released his file attachment MOD yet. I believe he's waiting for v3.4.01 before he releases it.

Go to Top of Page

simonettaj
Starting Member

Australia
5 Posts

Posted - 22 August 2002 :  01:50:40  Show Profile
Thanks for the info I guess I will wait for the new point version to come out
quote:
Originally posted by alex042

quote:
Also point me to HuwR completed upload mod for 3.4 can't seem to find it?


Although completed, I don't think HUWR has released his file attachment MOD yet. I believe he's waiting for v3.4.01 before he releases it.



Go to Top of Page

bkpearson
Starting Member

USA
1 Posts

Posted - 26 August 2002 :  11:56:41  Show Profile  Visit bkpearson's Homepage  Send bkpearson an ICQ Message  Send bkpearson a Yahoo! Message
quote:
Originally posted by Michael Schmidt

Has anyone had any success installing this mod on snitz 3.4? I can't see any reason why there'd be any problems, but i received an email from someone asking for help. I dont even have 3.4 yet so i havent been able to try it.

Thanks.

Michael



I've installed your file attachment mod, but had to modify it to use a component for uploads. I used the free aspSmartUpload from http://www.aspsmart.com/aspSmartUpload/. Works like a champ. Also allows up to 4 files at a time. If anyone wants the mod, I'll post it on my puny website.

I never could get the web/file permissions worked out with the pure ASP version.

I upgraded to 3.4.01 this morning and made the changes and it still works fine.

-bp

Edited by - bkpearson on 26 August 2002 11:58:56
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 26 August 2002 :  12:04:50  Show Profile  Visit dayve's Homepage
not a lot of people can take advantage of an asp component because their host does not have it installed.

Go to Top of Page

alex042
Average Member

USA
631 Posts

Posted - 26 August 2002 :  12:39:41  Show Profile  Send alex042 an AOL message  Send alex042 a Yahoo! Message
quote:
not a lot of people can take advantage of an asp component because their host does not have it installed.


Maybe not on free servers, but my host that I pay for has several components installed.
Go to Top of Page

Aaron S.
Average Member

USA
985 Posts

Posted - 26 August 2002 :  12:49:44  Show Profile  Visit Aaron S.'s Homepage
You can also use XMLHTTP to upload files.

BTW: I will be looking at the Avatar Upload code, and might want to upgrade it to 3.4.

--Aaron

DOWNLOAD GREAT NEW MODS HERE
Go to Top of Page

GTEUK
Starting Member

7 Posts

Posted - 26 August 2002 :  13:04:45  Show Profile  Visit GTEUK's Homepage
I have looked at all the code and created a new upload may not be as good but with it I check file size,extension,type before upload, the reason for this is to upload graphics and data to different folders I am also looking at a way to incorperate a dynamic resize of graphics where needed, i.e. avatars and such.

I have all the individual modules now I just need to impliment it, if it all works I will make it into a mod. I am also looking at dynamic resize of remote graphics, so far people are saying this cannot be done but it can just having a problem with transparent gifs


http://www.hostingyou.co.uk,, UK ASP hosting made simple
Go to Top of Page

BLK - Jetta
Starting Member

23 Posts

Posted - 26 August 2002 :  13:40:26  Show Profile
quote:
Originally posted by dayve



not true, yes it uses the same components, but it is very good code. I've been using it ever since I went to 3.3 and I keep seeing everyone say it doesn't work when in fact it does. the only thing I had to modify SLIGHTLY was my uploadengine.asp and I will gladly give you my copy of it. otherwise it works like a champ.


http://www.nineinchnailz.com



I would love to get a hold of your SLIGHTLY modified "uploadengine.asp" as I would like to continue using HUWRS Mod for my 3.4 forum. Thanks!

Mess with the best...
Go to Top of Page

GTEUK
Starting Member

7 Posts

Posted - 26 August 2002 :  13:52:44  Show Profile  Visit GTEUK's Homepage
Here is my upload engine code which works a treat

<%

Class FileUploader
Public Files
Private mcolFormElem

Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub

Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub

Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
End Property

Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound

biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))

If (nPosEnd-nPosBegin) <= 0 Then Exit Sub

vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)

Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))

nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)

If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New UploadedFile

nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))

nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))

oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))

nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)

If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If

nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
Loop
End Sub
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class

Class UploadedFile
Public ContentType
Public FileName
Public FileData

Public Property Get FileSize()
FileSize = LenB(FileData)
End Property

Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex

If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"

Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub

Set oFile = oFS.CreateTextFile(sPath & FileName, True)

For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next

oFile.Close
End Sub

Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub

If IsObject(oField) Then
oField.AppendChunk FileData
End If
End Sub

End Class
%>

http://www.hostingyou.co.uk,, UK ASP hosting made simple
Go to Top of Page

simonettaj
Starting Member

Australia
5 Posts

Posted - 28 August 2002 :  01:14:41  Show Profile
What do I do with this (code) to get it to work with 3.4.xx?
All I want is a simple way to incorporate Mike's File Attachment mod with the new forum.
Could someone tell me exactly step by step how to incorporate his code with all the response.writes in the new forum code(3.4.xx)?
quote:
Originally posted by GTEUK

Here is my upload engine code which works a treat

<%

Class FileUploader
Public Files
Private mcolFormElem

Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub

Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub

Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
End Property

Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound

biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))

If (nPosEnd-nPosBegin) <= 0 Then Exit Sub

vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)

Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))

nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)

If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New UploadedFile

nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))

nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))

oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))

nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)

If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If

nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
Loop
End Sub
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class

Class UploadedFile
Public ContentType
Public FileName
Public FileData

Public Property Get FileSize()
FileSize = LenB(FileData)
End Property

Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex

If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"

Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub

Set oFile = oFS.CreateTextFile(sPath & FileName, True)

For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next

oFile.Close
End Sub

Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub

If IsObject(oField) Then
oField.AppendChunk FileData
End If
End Sub

End Class
%>


Go to Top of Page

Michael Schmidt
Starting Member

23 Posts

Posted - 28 August 2002 :  22:35:35  Show Profile  Visit Michael Schmidt's Homepage  Send Michael Schmidt an AOL message  Send Michael Schmidt an ICQ Message  Send Michael Schmidt a Yahoo! Message
here is the code that needs to be inserted into post.asp converted to Response.Write's:


Response.Write("<tr>")
Response.Write("<td bgColor=""" & strPopUpTableColor & """> </td>")
Response.Write("<td bgColor=""" & strPopUpTableColor & """ valign=""center"">")
Response.Write("<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize """>")
Response.Write("<a href=""#"" onClick=""window.open('upload.html','Uploading','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=400,height=300');""><img src=""icon_paperclip.gif"" border=0>Insert File Attachment</a><br>")
Response.Write("</font>")
Response.Write("</td>")
Response.Write("</tr>")


search for the text 'Check here to include your profile signature.' and insert that code immediately before the <tr> tag that encompasses the signature checkbox tag.

that should do it for 3.4.x

Michael D. Schmidt mds47
http://www.people.cornell.edu/pages/mds47/index.html

Edited by - Michael Schmidt on 28 August 2002 22:37:26
Go to Top of Page

simonettaj
Starting Member

Australia
5 Posts

Posted - 29 August 2002 :  01:21:25  Show Profile
Thanks Michael it works except I had to remove the Response.Write("<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize """>")
line as it kept bringing up this error below.
I tried a few things but not that skilled enough to work out what's going on.

Thanks for doing that

Are you going to include an official release ASAP?

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/forum/post.asp, line 1052

Response.Write("<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize """>")
----------------------------------------------------------------------------------------^
quote:
Originally posted by Michael Schmidt

here is the code that needs to be inserted into post.asp converted to Response.Write's:


Response.Write("<tr>")
Response.Write("<td bgColor=""" & strPopUpTableColor & """> </td>")
Response.Write("<td bgColor=""" & strPopUpTableColor & """ valign=""center"">")
Response.Write("<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize """>")
Response.Write("<a href=""#"" onClick=""window.open('upload.html','Uploading','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=400,height=300');""><img src=""icon_paperclip.gif"" border=0>Insert File Attachment</a><br>")
Response.Write("</font>")
Response.Write("</td>")
Response.Write("</tr>")


search for the text 'Check here to include your profile signature.' and insert that code immediately before the <tr> tag that encompasses the signature checkbox tag.

that should do it for 3.4.x

Go to Top of Page

GTEUK
Starting Member

7 Posts

Posted - 29 August 2002 :  14:08:41  Show Profile  Visit GTEUK's Homepage
looks like a simple error, try inserting

Response.Write("<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>")

instead

http://www.hostingyou.co.uk,, UK ASP hosting made simple
Go to Top of Page
Page: of 15 Previous Topic Topic Next Topic  
Previous Page | 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.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07