Author |
Topic |
|
tinem
Junior Member
Denmark
209 Posts |
Posted - 25 March 2005 : 06:22:40
|
When I upload a file with a space in the name it's not functioning and there is not showing an alert box. How can I make this MOD use filenames with spaces?
My outputFile.asp can be seen here http://www.tinemuller.dk/tine_gaia_snitz_forum/outputFile.asp.txt |
This account was hacked by that very honest guy, Image. Better take care with your personal data, if you register to his forums or he will hack into your account here, as well. |
|
rodham
New Member
65 Posts |
Posted - 25 March 2005 : 15:53:17
|
Try something like:
' replace Space with Underscore
filename = Replace(Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")), " ", "_")
|
|
|
tinem
Junior Member
Denmark
209 Posts |
Posted - 26 March 2005 : 03:53:40
|
Thanks for your reply but before I try it have you seen this answer and do you know what 3 lines he are talking about?
All you other people here who uses this MOD - what are YOU using to solve this problem?
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=51110&whichpage=4&SearchTerms=proeder - from "smoutc" -------------- Another problem I noted with this module is that it does not allow spaces in the filenames, but the original Mike's File attachment mod always did. At the bottom of the outputfile.asp is the "isValidString function", which is where it checks the filename for invalid characters. I just put a ' in front of the three lines related to checking for spaces to remove this restriction, and the mod seems to still work fine. I was unclear why this change was made. (Do certain browsers or OS's have trouble handling file downloads with spaces in the name??) -------------- |
This account was hacked by that very honest guy, Image. Better take care with your personal data, if you register to his forums or he will hack into your account here, as well. |
|
|
rodham
New Member
65 Posts |
Posted - 26 March 2005 : 06:40:54
|
I hadn't checked the isValidString function at the bottom of your outputFile.asp but there it is, and it has a mistake, me thinks!
' extra checks
' no two consecutive dots or spaces
if not bTemp then
bTemp = InStr(sValidate, "..") > 0
end if
if not bTemp then
bTemp = InStr(sValidate, " ") > 0
end if
if not bTemp then
bTemp = (len(sValidate) <> len(Trim(sValidate)))
end if 'Addition for leading and trailing spaces
' if any of the above are true, invalid string
IsValidString = Not bTemp
bTemp = InStr(sValidate, " ") > 0 is checking for only one space when it should be checking for two Put another space between the quotes |
|
|
tinem
Junior Member
Denmark
209 Posts |
Posted - 26 March 2005 : 07:56:15
|
Yes that did it, thanks.:-)
I have now uploaded the file again to here http://www.tinemuller.dk/tine_gaia_snitz_forum/outputFile.asp.txt
I have another question - when you upload a file and you want the file to be shown in the message you get a line break and the clips and the text Download Attachment: and then the filename and the filesize. Wouldn't it be better to only get the file instead so that it can stay in the sentence where you put your curser?
I have made a printscreen of a message here http://www.tinemuller.dk/tine_gaia_snitz_forum/div/uploadfiles.gif
The 2 first is uploaded from my computer and now it's functioning with a space in the filename and the last is an image from the folder which has been uploaded before.
Is this the way it should look - I'm sure there must be something wrong here so please check my file and tell me which code to change in outputFile.asp.
|
This account was hacked by that very honest guy, Image. Better take care with your personal data, if you register to his forums or he will hack into your account here, as well. |
Edited by - tinem on 26 March 2005 10:44:17 |
|
|
rodham
New Member
65 Posts |
Posted - 26 March 2005 : 18:26:35
|
Not sure if I understand exactly what you want. If you are looking to reduce some of the text and line breaks then consider some of these choices: Line 197: To remove the line break and text remove
|b|Insert Image:|/b||br|
Line 209:
opener.document.PostTopic.Message.value+="\n\n|img|<% =iconimage %>|/img|
|b|Download Attachment:|/b| |url=\"<% =subfolder %>/<% =filename %>\"|
<% =oldfilename %>|/url||br|<% =strFileSize %>"; To remove the Paper Clip image, remove: |img|<% =iconimage %>|/img| To remove the Download Attachment:, remove: |b|Download Attachment:|/b| To remove the line break and filesize, remove: |br|<% =strFileSize %>
I changed the [ and ] to | so that the code would display |
Edited by - rodham on 26 March 2005 19:35:17 |
|
|
tinem
Junior Member
Denmark
209 Posts |
Posted - 27 March 2005 : 04:57:33
|
Thanks for your reply. I will suggest the owner of the forum this two ways to show the images and will be back later if it's not functioning.
It's mentioned that a member can delete their own files if they don't want to use them anymore but when I login as a member I can't get access to the folder I get a message "Directory Listing Denied, This Virtual Directory does not allow contents to be listed." when I test the folder for the upload and membername in Explorer - What's wrong?
I can as a Admin delete the files but I thought that members too could delete their files? From where should it be possible to delete this files?
Maybe I should just live without this option and write in the message that if a member wish to get the file deleted he could sent a message to the Admin for getting the file deleted?
|
This account was hacked by that very honest guy, Image. Better take care with your personal data, if you register to his forums or he will hack into your account here, as well. |
Edited by - tinem on 27 March 2005 06:36:42 |
|
|
tinem
Junior Member
Denmark
209 Posts |
Posted - 30 March 2005 : 03:54:05
|
quote: Originally posted by tinem It's mentioned that a member can delete their own files if they don't want to use them anymore but when I login as a member I can't get access to the folder I get a message "Directory Listing Denied, This Virtual Directory does not allow contents to be listed." when I test the folder for the upload and membername in Explorer - What's wrong?
I can as a Admin delete the files but I thought that members too could delete their files? From where should it be possible to delete this files?
Maybe I should just live without this option and write in the message that if a member wish to get the file deleted he could sent a message to the Admin for getting the file deleted?
I have solved the problem. I didn't realise that a link was made in the top of the site "My files" where users can delete there uploaded files.:-)
|
This account was hacked by that very honest guy, Image. Better take care with your personal data, if you register to his forums or he will hack into your account here, as well. |
|
|
|
Topic |
|