vbscript - Classic ASP - looping through folder with large amount of images -
i maintaining site uses html editor image upload feature. when click upload opens popup lists path every image in folder. there more 7000 images in folder.
the code quite messy. uses scripting.filesystemobject array of files , loops using each statement.a response.write used display each file's info , reason issue occurring if there's more 4015 images in folder. no error occurring such seems function writing out files fails silently , page stops rendering.
i confused why works when there's less 4015 files. memory issue ? expecting receive error of sort.
thanks info.
below response.write being used each file
response.write "<tr style='background:" & scolorresult & "'>" & vbcrlf & _ "<td><img src='images/"&sicon&"'></td>" & vbcrlf & _ "<td valign=top width=100% ><u id=""idfile"&nindex&""" style='cursor:pointer;' onclick=""selectfile(" & nindex & ")"">" & ofile.name & "</u> <img style='cursor:pointer;' onclick=""downloadfile(" & nindex & ")"" src='download.gif'></td>" & vbcrlf & _ "<td valign=top align=right nowrap>" & formatnumber(ofile.size/1000,1) & " kb </td>" & vbcrlf & _ "<td valign=top nowrap onclick=""deletefile(" & nindex & ")""><u style='font-size:10px;cursor:pointer;color:crimson' " & sfolderadmin & ">" & vbcrlf if not bwritefolderadmin response.write "<script>document.write(gettxt('del'))</script>" & vbcrlf end if response.write "</u></td></tr>" & vbcrlf
sounds issue here response buffer filling up. either of these solutions should work:
- disable buffering adding
response.buffer = false
first line of code. - leave buffering enabled call
response.flush()
@ intervals flush buffer.
Comments
Post a Comment