Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Web Development & Graphic Design Problem Solving for Graphic Design, PHP, ASP, Perl, MySQL, SQL, XML, HTML issues

Reply
 
Topic Tools
  #1  
Old June 7th, 2008, 05:03 PM
FrEaKmAn FrEaKmAn is offline
Senior Member
 
Join Date: Aug 2005
Posts: 477
Question File name and location

Hello

So I'll host some files and I need some advice regarding filenames, here is my code for download:

PHP Code:
<?php
$filename 
"1234.rar";
header("Pragma: public"); // required 
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Transfer-Encoding: binary"); 
header("Content-type: application/octet-stream");
header("Content-Length: ".filesize($filename));
header("Content-Disposition: attachment; filename=\"my-new-name.rar\"");
readfile($filename);
?>
everything works ok, now I have files located in folder (is same level as public_html) so it can't be accessed via http and I think that this is secure as it can be. Now I was thinking about encoding names of files and then decode it on every download, so that I hide the real file name..

Do you find this secure enough, ok encode/decode is waste of time? I did find some great encrypts, but they also include some "weird" symbols, and using just md5 looks just too much noob

I also must mention that my script doesn't show location of the file, everything is done in background and then the above function is called, so nobody even knows the real name of files, location etc... but again I would be in a big problem if I made a mistake and open a door to hackers...
Reply With Quote
  #2  
Old June 7th, 2008, 05:42 PM
Buzz Buzz is offline
Cyber Tech Help Moderator
 
Join Date: Sep 2000
O/S: MacOS
Location: Oregon, USA
Posts: 4,005
You could throw a timestamp in the filename along with a random alpha character or two at the beginning. Tends to look logical and ok without being too "weird." I do something similar as well and personally feel hiding the actual file names is a good measure to keep people from guessing other file names.
Reply With Quote
  #3  
Old June 7th, 2008, 09:52 PM
FrEaKmAn FrEaKmAn is offline
Senior Member
 
Join Date: Aug 2005
Posts: 477
can you give an example? maybe on PM if it's private...
Reply With Quote
  #4  
Old July 4th, 2008, 06:11 PM
FrEaKmAn FrEaKmAn is offline
Senior Member
 
Join Date: Aug 2005
Posts: 477
Hello

I'll just use this topic, I'm using the script posted above in a function located in class which a call within class. It works, but when I refresh the page, for some reason I can see the html source code...
Reply With Quote
  #5  
Old July 6th, 2008, 04:08 AM
enat66's Avatar
enat66 enat66 is offline
CTH Subscriber
 
Join Date: Dec 2001
O/S: Windows Vista
Location: Wisconsin
Age: 35
Posts: 3,101
Sorry I didn't follow that. You can only see it when you refresh or when you don't refresh?

Is it possible to link to the site or give us a sample of the code that is doing it.

Keep in mind if you are posting information to a page (from a form for example) you can't guarantee the browser will resend the posted information (most browsers will ask if one wants to resend the information).
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Topic Topic Starter Forum Replies Last Post
open file location problem Antariksh Windows 7 1 May 1st, 2013 04:07 PM
file location and post FrEaKmAn Web Development & Graphic Design 1 February 24th, 2008 04:39 AM
Sound File Location ultraman Windows XP 1 February 1st, 2006 11:07 AM
Can't find file location.... DoubleShimmer Malware Removal 2 June 14th, 2004 05:37 PM
Default file location Mary Ann Windows XP 1 April 5th, 2003 07:17 AM


All times are GMT +1. The time now is 01:43 PM.