Author |
Topic |
|
clavit
Starting Member
14 Posts |
Posted - 25 January 2004 : 20:22:56
|
I have included a copy of my script for outputfile.asp I would like my pic's to be displayed in the forum but so far had no luck. Would any be able to look this over for me??
<!--#include file="upload.asp"--> <!--#INCLUDE FILE="config.asp" --> <%
subfolder = "uploaded" iconimage = "images/icon_paperclip.gif"
Response.Expires=0 Response.Buffer = TRUE Response.Clear
byteCount = Request.TotalBytes RequestBin = Request.BinaryRead(byteCount) Dim UploadRequest Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin membername = UploadRequest.Item("memberName").Item("Value") subfolder = subfolder & "/" & membername contentType = UploadRequest.Item("blob").Item("ContentType") filepathname = UploadRequest.Item("blob").Item("FileName") filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) oldfilename = filename filename = Year(Now) & Month(Now) & Day(Now) & Hour(Now) & Minute(Now) & Second(Now) & "_" & filename
' --- CHECK FILE FOR ACCEPTABILITY --- if oldfilename = "" then response.redirect "pop_upload_new.asp" else extension = LCase(Mid(filename,InStrRev(filename,"."))) end if
select case extension case ".jpg", ".jpeg", ".gif" allowFile=true case else allowFile=false end select
If allowFile and byteCount <= 180000 Then
value = UploadRequest.Item("blob").Item("Value")
'Create FileSytemObject Component Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject") memberPath = (Server.MapPath("uploaded") & "\" & membername) If not ScriptObject.FolderExists(memberPath) then ScriptObject.createFolder(memberPath) end if
'Create and Write to a File pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14 Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & SUBFOLDER & "\" & filename)
For i = 1 to LenB(value) MyFile.Write chr(AscB(MidB(value,i,1))) Next MyFile.Close
If byteCount < 1000 Then strFileSize = Round(byteCount,2) & " Bytes" ElseIf strFileSize < 1000000 Then strFileSize = Round(byteCount/1000,2) & " KB" Else strFileSize = Round(byteCount/1000000,2) & " MB" End If
Response.Write "<html>" & vbNewline Response.Write "<head>" & vbNewline Response.Write "<title>Upload File Result is Good</title>" & vbNewline
Response.Write "<script>" & vbnewline ext = left(filename,4) if ext = ".jpg" or ext = ".gif" or ext = ".png" then Response.Write "window.opener.PostTopic.Message.value=window.opener.PostTopic.Message.value + ""\n\n""" & vbnewline else Response.Write "window.opener.PostTopic.Message.value=window.opener.PostTopic.Message.value + ""\n\nDownload Attachment: [url=\""" & strForumURL & SUBFOLDER & "/" & filename & "\""] " & oldfilename & "[/url] " & strFileSize & """;" & vbnewline end if Response.Write "</script>" & vbnewline
Response.Write "</head>" & vbNewline Response.Write "<body bgColor=""" & strHeadCellColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strActiveLinkColor & """ onUnLoad=""window.opener.focus();"">" & vbNewline Response.Write "<p align=""center"">" & vbNewline Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strHeadFontSize & """ color=""" & strHeadFontColor & """>The following file has been successfully recieved</font></ br><hr size=""1"" color=""" & strHiLiteFontColor & """>" & vbNewline Response.Write " <table>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Filename </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & oldfilename & "</font> </td></tr>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Extension </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & extension & "</font> </td></tr>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Size </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & strFileSize & "</font> </td></tr>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Link </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & subfolder & "/" & filename & "</font> </td></tr>" & vbNewline Response.Write " </table><hr size=""1"" color=""" & strHiLiteFontColor & """>" & vbNewline Response.Write "<a href=""#"" onClick=""window.close();"">Please click here to close this window.</a>" & vbNewline Response.Write "</p>" & vbNewline Response.Write "</body>" & vbNewline Response.Write "</html>" & vbNewline Else
Response.Write "<html>" & vbNewline Response.Write "<head>" & vbNewline Response.Write "<title>Upload File Has Errors</title>" & vbNewline Response.Write "</head>" & vbNewline Response.Write "<body bgColor=""" & strHeadCellColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strActiveLinkColor & """>" & vbNewline Response.Write "<p align=""center"">" & vbNewline Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strHeadFontSize & """ color=""" & strHeadFontColor & """>There is a problem with the file you are attempting to upload.</font></ br><hr size=""1"" color=""" & strHiLiteFontColor & """>" & vbNewline Response.Write " <table>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Filename </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & oldfilename & "</font> </td><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>File names must use only valid characters</font></td></tr>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Extension </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & extension & "</font> </td><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Certain file extensions are not accepted</font></td></tr>" & vbNewline Response.Write " <tr><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b> Size </b></font></td><td> <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>" & Round(byteCount/1000,2) & " KB</font> </td><td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>File sizes must be reasonable</font></td></tr>" & vbNewline Response.Write " </table><hr size=""1"" color=""" & strHiLiteFontColor & """>" & vbNewline Response.Write " <a href=""#"" onClick=""history.go(-1);"">Please click here to close go back and try again.</a>" & vbNewline Response.Write "</p>" & vbNewline Response.Write "</body>" & vbNewline Response.Write "</html>" & vbNewline
End If %> |
Edited by - clavit on 26 January 2004 17:50:55 |
|
Diabolic
Starting Member
5 Posts |
Posted - 25 January 2004 : 20:38:20
|
I have a bit of the same trouble myslef. The difference being that at one time my avatar did show and then after I updated my profile with a link or something my avatar went by by!
The really strange thing is that the avatars seem to work with the majority of the users on the baord with the same problem only happening to a few slect accounts. Now here is the really strange part, the avatar actually shows up when you click on my profile as but does not carry over to the board posts.
Any help would be beyond appreciated... |
|
|
Mindcontrol
New Member
52 Posts |
Posted - 27 January 2004 : 22:05:08
|
These problems must be out of range of knowledge but are you using one of these. ".jpg", ".jpeg", ".gif" |
Edited by - Mindcontrol on 27 January 2004 22:06:42 |
|
|
clavit
Starting Member
14 Posts |
Posted - 28 January 2004 : 07:35:48
|
Yes It puts a link up but the picture will not show up |
|
|
|
Topic |
|
|
|