Author |
Topic |
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 18 September 2004 : 17:44:05
|
quote: Originally posted by P3TER
Well, I have played around with this code, and have created a function that fixes the specific problem I was experiencing. My users were attempting to upload files with non alpha-numeric characters in the filename (spaces, parentheses, hyphens etc) which in every case caused the thumbnailing function to fail, and in many cases caused the image display function to fail. another side effect was that a copied shortcut embedded in a forum posting within (img)(/img) tags would fail since it sometimes contained characters that are treated as risky and therefore stripped by the forum post functions..
I must warn you that I DO NOT consider myself to be a programmer, therefore I would be happy for anyone to tell me that my code sucks, as long as their response contains the source code to how it should be done!
Adding the code Insert just above the last line "%>" at around Line 354 of inc_photo_album_functions.asp quote: function purify_filename( FileName ) '********************************************************** '* P3TER's filename purifier function '* ---------------------------------- '* Turns a filename into pure alpha numeric, removing all '* characters other than numbers, letters, and "." '********************************************************** For ParseFileName = 1 to len(FileName) ASCII = Asc(Mid(FileName,ParseFileName,1)) if ASCII <46 THEN Dirty = TRUE 'Flag these characters as dirty = !"#$%&'()*+,-
if ASCII >=58 AND ASCII <65 THEN Dirty = TRUE 'Flag these chars as dirty = :;<=>?@
if ASCII >=91 AND ASCII <97 THEN Dirty = TRUE 'Flag these chars as dirty = [\]^_`
if ASCII >=123 THEN Dirty = TRUE 'Flag these chars as dirty = {|}~ onwards
If Dirty = True then FileName = Replace (FileName,chr(ASCII),"/") End If Dirty=false next FileName = Replace (FileName,"/","") purify_filename = FileName end function
Then, add this entry to around line 294 of ToFileSystem.asp, immediately above the "' Compile path to save file to" comment line.quote: 'Call Filename purifier function strFileName = purify_filename (strFileName) 'End of Filename purifier function
Removing the effect of this function is simple - just comment out the middle of the 3 lines above, and resave ToFileSystem.asp
Using this function when uploading a file means that a file named "F [i-l_e#-n'a me%1.jpg" would upload a file named "Filename1.jpg"
I would like to hear any feedback from anyone who tries this code. - please post it here!
This fix worked very well for me...thanks |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 18 September 2004 : 17:46:25
|
quote: Originally posted by DavidRhodes
To fix the bug where some users cannot edit pictures and get sent to the photo_album.asp page do the following:
photo_album_detail.asp line 107 replace if Trim(UserName) = Trim(strDBNTUserName) then with if Trim(LCase(UserName)) = Trim(LCase(strDBNTUserName)) then
Should do the trick
As did this one, thanks David! |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 27 September 2004 : 08:43:47
|
Alright there, Just wondered if anyone has found a fix fix not being able to see to image after you've clicked on the thumbnail...this is when using Netscape only (i'm using netscape 7.2)?
Or has no one else found this problem?
Thanks.. |
Edited by - Doughnut on 27 September 2004 08:54:43 |
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 27 September 2004 : 09:01:25
|
Here's a screenshot in case I've not described the problem properly..... note the missing pic at the bottom!
The missing pic
Thanks... |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 12 December 2004 : 23:00:23
|
Well, I've got a little free time end of this year beginning of next I will attempt to fix all known bugs with this mod.
Off the top, it doesn't seem to work with firefox at all. I don't know why. I have updated code for the uploader that should fix some of the upload problems. There will be no functional or cosmetic changes just bug fixes. I will post a list of bugs slated to be fixed in the next few days.
Wes |
|
|
ken derringer
Starting Member
40 Posts |
Posted - 14 December 2004 : 07:44:28
|
Hi All, When I try to do a photo "unvisible", it's doesn't work... The photo are ALWAYS visible... Can you help me?
|
|
|
ken derringer
Starting Member
40 Posts |
Posted - 14 December 2004 : 10:28:13
|
Ok. I have resolved my problem. There was an error on photo_album_view.asp. Find this line (approx line 78):
sqldtl = "select * from "& strMemberTablePrefix & "album where Member_Id ="&trim(cint(tMID))&" and Photo_Cat = "&trim(cint(cid))
And replace it with this:
sqldtl = "select * from "& strMemberTablePrefix & "album where Member_Id ="&trim(cint(tMID))&" and Photo_Status = 1 and Photo_Cat = "&trim(cint(cid))
|
|
|
Doughnut
Starting Member
United Kingdom
40 Posts |
Posted - 14 December 2004 : 11:20:22
|
quote: Originally posted by burthold
Well, I've got a little free time end of this year beginning of next I will attempt to fix all known bugs with this mod.
Off the top, it doesn't seem to work with firefox at all. I don't know why. I have updated code for the uploader that should fix some of the upload problems. There will be no functional or cosmetic changes just bug fixes. I will post a list of bugs slated to be fixed in the next few days.
Wes
That would be great...finish off a nice mod If you or anyone else does decide to work on this can I make a suggestion of addding a function for users to arrange their photos in the order they want them.
Be lucky... |
Edited by - Doughnut on 14 December 2004 11:21:24 |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 14 December 2004 : 23:56:16
|
Visible not Visible bug fixed Invalid charaters fixed User redirected on bad name fixed thumbnail aspect ratio fixed one table fixed with mozilla based browsers another found though Files not uploading with mozilla based browsers seems to be related to the field not being passed properly to the upload function. |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 16 December 2004 : 14:44:05
|
upload with firefox fixed moved to V3 of the upload code |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 16 December 2004 : 22:57:50
|
access db setup fixed cannot find the security holes people are talking about even if you manually change the user id in the string the page checks and keeps you from deleting or modifiying files or uploading into others albums that I can duplicate. |
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 17 December 2004 : 04:51:56
|
Great you are working on this...thanks. |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 17 December 2004 : 16:29:27
|
Fixed last formatting error for Firefox browsers Cannot duplicate the search error.
I'm hopeing to post a new build this weekend for down load on snitzbitz and my web site.
Wes |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 17 December 2004 : 18:10:49
|
Nconvert doesn't seem to work with windows 2003, I can run it manually on the server but it doesn't work using aspexec.
Correction, its a permissions issue. instructions will be annotated to reflect the correct permissions.
|
Edited by - burthold on 17 December 2004 22:21:37 |
|
|
burthold
Junior Member
USA
426 Posts |
Posted - 17 December 2004 : 22:25:10
|
redirect on approval fixed |
|
|
Topic |
|