Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - problem with uploading
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

problem with uploading

 Post Reply Post Reply Page  12>
Author
fantasy View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 01 July 2003
Location: China
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote fantasy Quote  Post ReplyReply Direct Link To This Post Topic: problem with uploading
    Posted: 06 October 2003 at 6:32am
wwf 7.50 can put each user's uploads into seperate directories named after their own usernames ,but here i found one "error": if the username is not only in English ,such as  Chinese,the file(take image for example) cannt be displayed in the post. The file is already uploaded,but just cannt be displayed if the path contain other character sets such as Chinese.  How to fix it?
Welcome to my website:
PC Pioneer - the latest software news and forum site, Neowin in China!
http://www.pcpchina.com
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 7:35am
You may need to edit the file functions_upload.asp to remove the making of folders.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 7:44am
The forum uses the following function in the file functions_filters.asp to strip any non URL allowed charcaters:-

'******************************************
'***  Non-Alphanumeric Character Strip ****
'******************************************

'Function to strip non alphanumeric characters
Private Function characterStrip(strTextInput)

    'Dimension variable
    Dim intLoopCounter     'Holds the loop counter
   
    'Loop through the ASCII characters
    For intLoopCounter = 0 to 47
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the ASCII characters numeric characters to lower-case characters
    For intLoopCounter = 91 to 96
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the extended ASCII characters
    For intLoopCounter = 58 to 64
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
    'Loop through the extended ASCII characters
    For intLoopCounter = 123 to 255
        strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0)
    Next
   
   
    'Return the string
    characterStrip = strTextInput
   
End Function


I've marked the a number in red that could be increased to also strip Chineese charcaters as I don't know which part of the ASCII set they fall into as I was lead to believe that ACSCII only went to 255. If you can finout and let me know I will make the changes in teh code.
Back to Top
fantasy View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 01 July 2003
Location: China
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote fantasy Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 7:49am
thanks, boRg. Do you know the exact reason of this "error"? I wondered if I can replace the username with userid or usercode etc. I don't want to put images from all users simply in one folder.... btw,is that error really caused by the forum code? I paste the image URL to the address bar, and it failed to open the image ,too.But the image is there indeed...

Edited by fantasy
Welcome to my website:
PC Pioneer - the latest software news and forum site, Neowin in China!
http://www.pcpchina.com
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 8:04am
You could use the user ID.

A URL link to a file, web page, iamge, etc. can only contain western characters to be valid. So the function I pasted above tries to remove any non-western characters but as I have no chinese cahracters to test with it's very difficult to write code that will also stip these types of characters, I imagine languages like russian maybe the same.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 8:08am
Just one quick test, if you increase the number in the function I pasted into the other post to say 2000 does it strip chinese characters from the user name folders?
Back to Top
fantasy View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 01 July 2003
Location: China
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote fantasy Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 11:14am

I have modified the number and changed it to 2000,but the problem still exists. Anyhow, there only can be 255 ASCII characters, in fact,one Chinese character was treated as a combination of two extend ASCII characters in Computer...

I noticed that despite I didn't change anything, the image can be displayed on my own machine(windows server 2003 simplified Chinese version with IIS 6.0);but everything goes bad when it was running on my site ISP's server.

So I consulted my ISP and they replied that the sever doesn't support the directory that contain Chinese characters very well... so I think this prob is "solved", I have to change username to userid or something else...

thanx,boRg



Edited by fantasy
Welcome to my website:
PC Pioneer - the latest software news and forum site, Neowin in China!
http://www.pcpchina.com
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 06 October 2003 at 11:20am
I also installed support for Chinese on my machine and found that once I had done that directories with Chinese characters worked sucessfully in my browser.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.