#174126 - 01/17/0706:25 PMRe: Attachment not found
[Re: ntdoc]
Gizmo
Registered: 06/04/06
Posts: 11968
Loc: Portland, OR; USA
The number in front of the attachment is so there are no collisions (such as users uploading the same named images to your site).
As for the file in question; I'm thinking it's because of the extension .ini; does IIS have some directive that blocks certain filetypes from being dowloanded?
That's what I'm initially thinking but renamed a file to just .db and it didn't like that either.
I'll try one with a zip and see if that works.
As for the number strategy then why not just obfuscate the whole thing like most sites do.
Something like: mysite.com/folder/^^*H#%&w208
would equal something like: mysite.com/folder/mynewfile.zip
The filename ^^*H#%&w208 would be unique maybe use some GUID type filename creator (I'm sure PHP has something like that built-in or someone has created a script for it already)
Then the database stores that unique name AND the real name and when it downloads it to the client it renames it to the real name.
That is for uploads. Outside of the forum in IE/FF you can't download the file even though it's there on the server so I'm betting it's not related to UBBT and just coincidence that I found it via UBBT.
Sir yes sir, I agreed it had to be IIS. Just could not see how UBBT could be involved except for the file name.
@Rick If you can please think of another way to handle attachments without pre-pending a number to it. I would really like to see attachments retain their ORIGINAL file names like other Web apps do.
#175405 - 01/24/0702:34 AMRe: Attachment not found
[Re: ntdoc]
Gizmo
Registered: 06/04/06
Posts: 11968
Loc: Portland, OR; USA
Originally Posted By: ntdoc
@Rick If you can please think of another way to handle attachments without pre-pending a number to it. I would really like to see attachments retain their ORIGINAL file names like other Web apps do.
this would be hard, considering the risk of file collisions...
Well I've not programmed in PHP but have worked in VB and we setup an FTP program that assigned a unique number to files so the user would never know the real file name so they could not manually download the file and there were over 5 million files and none of them were an issue with same file name even though users could upload/download files.
Can't say I've ever been on a system that handled files this way (not saying there are not other apps out there that don't, but none that come to mind).
I see it as a very easy task using MySQL and auto generated unique keys. Add a file it gives it a unique name, but also stores what the 'REAL' name is and even if it has to do a temporary file rename or something it then gives the user back the file with the REAL name.