Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Would be nice to have a mod for UBB Threads that will display an attachment 'nicer' within a posting, like it does in VBulletin.

The default method of UBB just says 'attachment' at the top of a posting. It doesn't say what the name of the attachment is, what type of file it is, and doesn't display a little icon corresponding to the type of file (ie. little pdf icon or ms word doc icon). The little icon is just a nice luxury, but it sure would be better to have something like:

Attachment: newsletter.pdf (540KB)(downloaded 4 times)

or such at the bottom of the posting, rather than the
UBB default of 'Attachment' and no other info.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
This needs to be updated - but I did this a while ago back for version 6.1. I was still learning so the code is probably sloppy..... but it worked.

Gave File Size - and Icon for the type of file it was.

Here is the link for it:
https://www.ubbdev.com/forum/showflat...=true#Post54633

Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Thanks for the link.

Curious that the default UBB attachment display is so weak in a mature product.

The VBulletin method is the logical method of displaying and linking attachments. Baffles me why UBB does it their way.

Attachment: newsletter.pdf (454KB)(4 downloads)

just makes so much more sense than

#9 date/time 'Attachment' (filename ?)(4 downloads)

Why display the download number (ie. #9)?
Why NOT display the filename of the attachment ?
Why not pickup the filesize and display that (a dialup user would want to know before downloading a 5MB file) ?

Baffling.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Although it's not air tight the reason the name isn't given is that then users could bypass the download script with a little effort on their part. Clicking on the link to the attachment enables the download script to check the access of the user before transfering the file.

More could be done to really make this a lot more secure at some point. I'm looking forward to that time.

Joined: Oct 2000
Posts: 117
Member
Member
Offline
Joined: Oct 2000
Posts: 117
one reason the file name is hidden is that it's obvious where the uploads directory is in both threads and vb. Knowing the name of the attachment will allow someone not logged in to download any attachment because they would know the name of the file. The way threads handles it keeps your attachments only for logged in users should you choose to protect them like they do here

IP numbers aren't meanlingless to most people who run forums.

The way attachments are handled is a personal opinion, but I like the way they are done here


Duke

"Life is tough, it's tougher if you're stupid."
Sponsored Links
Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
I am an asp programmer with vbscript and not yet up to speed on php, but in asp I have a download script that I programmed. I display the name of the download on the web page. When clicked, the name of the file is passed to my download.asp program, which checks the username and password against an SQL database, and if valid and logged in properly, the download.asp file will serve up the requested file (the user doesn't even know the actual server directory where the file is stored, and it is never displayed to them. Even when using tools to see the actual raw http Get/Post/etc.).

I name my download directory something non-guessable like
/asdf90qw3357e-0rsaa

It should be do-able, and shouldn't take much coding in a hack. I wish I knew PHP.

Last edited by rumrunner; 07/29/2003 11:58 PM.
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, but alot of people can easily guess /uploads/whatever.gif or the like of the location and manually enter it into the browser - bypassing the download script.

I think the file size should be added though. Although unlike my mod - it should be reworked to store the size in the database. As on a busy site with alot of attachements, I belive reading the file size can add alot of disk slamming for sure.

The number displayed isn't the Download number - it's the number of downloads. So you can tell something is popular if it's been downloaded x times. We use it here with modifications - so you can see what mods have been downloaded the most.

Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Put this in my edited post above, but will put it here also..

I name my download directory something non-guessable like
/asdf90qw3357e-0rsaa

And as I said, the way asp/vbscript works, my download.asp program 'grabs' the file from that directory, and serves it to the client browser without telling them the directory name where it came from. Directory path is not given to the client in any way (doesn't show up with raw http tools, property checks, and even programs like Getright or Flashget which try to resolve the real address).(this is on Win2000/2003 servers IIS 5/6).

Good point about the file sizes in the database. As long as it is cached in RAM there, it will save disk hits.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
The best solution is for the downloads to be placed outside the www root. The download script would need to send the correct headers and feed the downloaded file to the user. This would allow for the actual name of the file to be displayed since only those with access would be able to download it. There would be no way around this. (unless they have ftp access to your server of course) lol

The problem with making a hard to guess directory name is that if they have access to some downloads they then can figure out what the directory name is anyhow and then download other files they don't have access to. (provided they have the names of them)

Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Having a directory outside the webroot is a good idea.

Also, you are correct, if you freely give out the hard-to-guess directory name with other downloads, then you are not hiding anything. This would seem obvious. In the download area I setup, I don't do this. I always download only via the download.asp script, so the directory name is never given to the client. Then only see http://...../download.asp?newsletter.pdf and not the resolved true location of the file. IIS5/6 serves the file to the client and never shows them a resolved url. This is a solid type of anti-leech script.

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I wouldn't mind seeing the .threads download script fortified more. Perhaps in time.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yeah, even using a "download script" - I know on the mac you can right click and open it in a new window - then I would see the "real" URL.

Download script should be made to use Group Access - like we do here - standard.

Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Any php superstars willing to code this ?

Basically something like:

(icon) Attachment: newsletter.pdf (2MB)(35 downloads)

downloaded from a secure directory out of the webroot.

I predict I will be up to speed in 6-12 months to be able to attempt this in php (in vbscript I could do it now). Anyone want to volunteer to code this cool hack sooner ? Sounds like Josh already has it half written.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, I could probably update my other mod.

Got a little client backlog right now - (I was on vacation last week and it caused things to pile up) - so I can't tell when I can get it done. But I'll put it on my list.

Joined: Jul 2003
Posts: 8
Lurker
Lurker
Offline
Joined: Jul 2003
Posts: 8
Great.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)