Author |
Topic |
Etymon
Advanced Member
United States
2385 Posts |
Posted - 20 August 2002 : 18:30:12
|
I don't have v3.4 either. Would like to hear if your MOD works though.
|
|
|
simonettaj
Starting Member
Australia
5 Posts |
Posted - 22 August 2002 : 00:51:56
|
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? |
|
|
alex042
Average Member
USA
631 Posts |
Posted - 22 August 2002 : 01:36:04
|
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.
|
|
|
simonettaj
Starting Member
Australia
5 Posts |
Posted - 22 August 2002 : 01:50:40
|
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.
|
|
|
bkpearson
Starting Member
USA
1 Posts |
Posted - 26 August 2002 : 11:56:41
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 26 August 2002 : 12:04:50
|
not a lot of people can take advantage of an asp component because their host does not have it installed. |
|
|
|
alex042
Average Member
USA
631 Posts |
Posted - 26 August 2002 : 12:39:41
|
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.
|
|
|
Aaron S.
Average Member
USA
985 Posts |
Posted - 26 August 2002 : 12:49:44
|
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 |
|
|
GTEUK
Starting Member
7 Posts |
Posted - 26 August 2002 : 13:04:45
|
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 |
|
|
BLK - Jetta
Starting Member
23 Posts |
Posted - 26 August 2002 : 13:40:26
|
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...
|
|
|
GTEUK
Starting Member
7 Posts |
Posted - 26 August 2002 : 13:52:44
|
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 |
|
|
simonettaj
Starting Member
Australia
5 Posts |
Posted - 28 August 2002 : 01:14:41
|
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 %>
|
|
|
Michael Schmidt
Starting Member
23 Posts |
Posted - 28 August 2002 : 22:35:35
|
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 |
|
|
simonettaj
Starting Member
Australia
5 Posts |
Posted - 29 August 2002 : 01:21:25
|
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
|
|
|
GTEUK
Starting Member
7 Posts |
Posted - 29 August 2002 : 14:08:41
|
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 |
|
|
Topic |
|
|
|