how to secure documents in server

This is a discussion on how to secure documents in server within the PHP Language forums, part of the PHP Programming Forums category; Hello, Can anyone suggest me solution? I Need to manage different types of documents (doc,xls,ppt etc) in server. ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2008
RAZZ
 
Posts: n/a
Default how to secure documents in server

Hello, Can anyone suggest me solution?

I Need to manage different types of documents (doc,xls,ppt etc) in
server. I have folder structure to maintain these documents in server.

Say folder1 is having all doc files; folder2 is having all xls files
and so on.


Now these documents should not be able to get access through the url
by directly typing path.
E-g if I try to access directly www.mywebsite.com/folder1/xyz.doc it
will open the document in browser itself.
At the same time these documents should be access only through our
website once they are login. But without login also if you know the
path you can get these documents how should I avoid it?

How can I provide security to these documents in server?
Reply With Quote
  #2 (permalink)  
Old 07-18-2008
GArlington
 
Posts: n/a
Default Re: how to secure documents in server

On Jul 18, 11:05 am, RAZZ <rajat82.gu...@gmail.com> wrote:
> Hello, Can anyone suggest me solution?
>
> I Need to manage different types of documents (doc,xls,ppt etc) in
> server. I have folder structure to maintain these documents in server.
>
> Say folder1 is having all doc files; folder2 is having all xls files
> and so on.
>
> Now these documents should not be able to get access through the url
> by directly typing path.
> E-g if I try to access directlywww.mywebsite.com/folder1/xyz.docit
> will open the document in browser itself.
> At the same time these documents should be access only through our
> website once they are login. But without login also if you know the
> path you can get these documents how should I avoid it?
>
> How can I provide security to these documents in server?


Depending on webserver your should look at .htacceess for Apache or
httpd.ini for IIS...
Reply With Quote
  #3 (permalink)  
Old 07-18-2008
RAJ
 
Posts: n/a
Default Re: how to secure documents in server

On Jul 18, 3:08*pm, GArlington <garling...@tiscali.co.uk> wrote:
> On Jul 18, 11:05 am, RAZZ <rajat82.gu...@gmail.com> wrote:
>
>
>
> > Hello, Can anyone suggest me solution?

>
> > I Need to manage different types of documents (doc,xls,ppt etc) in
> > server. I have folder structure to maintain these documents in server.

>
> > Say folder1 is having all doc files; folder2 is having all xls files
> > and so on.

>
> > Now these documents should not be able to get access through the url
> > by directly typing path.
> > E-g if I try to access directlywww.mywebsite.com/folder1/xyz.docit
> > will open the document in browser itself.
> > At the same time these documents should be access only through our
> > website once they are login. But without login also if you know the
> > path you can get these documents how should I avoid it?

>
> > How can I provide security to these documents in server?

>
> Depending on webserver your should look at .htacceess for Apache or
> httpd.ini for IIS...


well we are using yahoo server and it doesn't allow .htaccess to
upload or manipulate by developers
so is there any other way? i just want that doc or xls files should
not be able to open directly unless person has properly login.
Reply With Quote
  #4 (permalink)  
Old 07-18-2008
Captain Paralytic
 
Posts: n/a
Default Re: how to secure documents in server

On 18 Jul, 11:14, RAJ <rajat82.gu...@gmail.com> wrote:
> On Jul 18, 3:08*pm, GArlington <garling...@tiscali.co.uk> wrote:
>
>
>
>
>
> > On Jul 18, 11:05 am, RAZZ <rajat82.gu...@gmail.com> wrote:

>
> > > Hello, Can anyone suggest me solution?

>
> > > I Need to manage different types of documents (doc,xls,ppt etc) in
> > > server. I have folder structure to maintain these documents in server..

>
> > > Say folder1 is having all doc files; folder2 is having all xls files
> > > and so on.

>
> > > Now these documents should not be able to get access through the url
> > > by directly typing path.
> > > E-g if I try to access directlywww.mywebsite.com/folder1/xyz.docit
> > > will open the document in browser itself.
> > > At the same time these documents should be access only through our
> > > website once they are login. But without login also if you know the
> > > path you can get these documents how should I avoid it?

>
> > > How can I provide security to these documents in server?

>
> > Depending on webserver your should look at .htacceess for Apache or
> > httpd.ini for IIS...

>
> well we are using yahoo server and it doesn't allow .htaccess to
> upload or manipulate by developers
> so is there any other way? i just want that doc or xls files should
> not be able to open directly unless person has properly login.- Hide quoted text -
>
> - Show quoted text -


You're not going to be able to do much on yahoo server I'm afraid. The
most common way to do this is to store the files outside of the web
root and use a php script to deliver the file.

I suggest you change hosts. There are much better value ones out there.
Reply With Quote
  #5 (permalink)  
Old 07-18-2008
RAZZ
 
Posts: n/a
Default Re: how to secure documents in server


> You're not going to be able to do much on yahoo server I'm afraid. The
> most common way to do this is to store the files outside of the web
> root and use a php script to deliver the file.
>
> I suggest you change hosts. There are much better value ones out there.


thank you for response can you suggest me bit in details regarding
"storing files outside of the web root and use a php script to deliver
the file"?
Reply With Quote
  #6 (permalink)  
Old 07-18-2008
Captain Paralytic
 
Posts: n/a
Default Re: how to secure documents in server

On 18 Jul, 11:36, RAZZ <rajat82.gu...@gmail.com> wrote:
> > You're not going to be able to do much on yahoo server I'm afraid. The
> > most common way to do this is to store the files outside of the web
> > root and use a php script to deliver the file.

>
> > I suggest you change hosts. There are much better value ones out there.

>
> thank you for response can you suggest me bit in details regarding
> "storing files outside of the web root and use a php script to deliver
> the file"?


Actually another way to do it is to store the files in a BLOB field in
a database and delivering them from there. Here is a tutorial for that
and you could adapt it for the file system version:
http://www.php-mysql-tutorial.com/php-mysql-upload.php
Reply With Quote
  #7 (permalink)  
Old 07-18-2008
RAZZ
 
Posts: n/a
Default Re: how to secure documents in server

On Jul 18, 3:50*pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 18 Jul, 11:36, RAZZ <rajat82.gu...@gmail.com> wrote:
>
> > > You're not going to be able to do much on yahoo server I'm afraid. The
> > > most common way to do this is to store the files outside of the web
> > > root and use a php script to deliver the file.

>
> > > I suggest you change hosts. There are much better value ones out there.

>
> > thank you for response can you suggest me bit in details regarding
> > "storing files outside of the web root and use a php script to deliver
> > the file"?

>
> Actually another way to do it is to store the files in a BLOB field in
> a database and delivering them from there. Here is a tutorial for that
> and you could adapt it for the file system version:http://www.php-mysql-tutorial.com/php-mysql-upload.php


That was really very good option but i have documents or doc files
which contains images and tables while downloading text are fine but
images and tables are coming in some encrypted format?
Reply With Quote
  #8 (permalink)  
Old 07-18-2008
Captain Paralytic
 
Posts: n/a
Default Re: how to secure documents in server

On 18 Jul, 12:31, RAZZ <rajat82.gu...@gmail.com> wrote:
> On Jul 18, 3:50*pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
> > On 18 Jul, 11:36, RAZZ <rajat82.gu...@gmail.com> wrote:

>
> > > > You're not going to be able to do much on yahoo server I'm afraid. The
> > > > most common way to do this is to store the files outside of the web
> > > > root and use a php script to deliver the file.

>
> > > > I suggest you change hosts. There are much better value ones out there.

>
> > > thank you for response can you suggest me bit in details regarding
> > > "storing files outside of the web root and use a php script to deliver
> > > the file"?

>
> > Actually another way to do it is to store the files in a BLOB field in
> > a database and delivering them from there. Here is a tutorial for that
> > and you could adapt it for the file system version:http://www.php-mysql-tutorial.com/php-mysql-upload.php

>
> That was really very good option but i have documents or doc files
> which contains images and tables while downloading *text are fine but
> images and tables are coming in some encrypted format?


I don't understand??? What difference does it make what the document
contains? A binary file is a binary file is a binary file! It can
contain anything whatsoever???
Reply With Quote
  #9 (permalink)  
Old 07-18-2008
Olaf Schinkel
 
Posts: n/a
Default Re: how to secure documents in server

RAZZ schrieb:
> Hello, Can anyone suggest me solution?
>
> I Need to manage different types of documents (doc,xls,ppt etc) in
> server. I have folder structure to maintain these documents in server.
>
> Say folder1 is having all doc files; folder2 is having all xls files
> and so on.
>
>
> Now these documents should not be able to get access through the url
> by directly typing path.
> E-g if I try to access directly www.mywebsite.com/folder1/xyz.doc it
> will open the document in browser itself.
> At the same time these documents should be access only through our
> website once they are login. But without login also if you know the
> path you can get these documents how should I avoid it?
>
> How can I provide security to these documents in server?


a) Set the directory to 0600
b) Send the files via a php script, which test the login before.
Like this:
// Check Login
// Send pdf as example:
header('Content-type: application/pdf');
// If it is an download:
header('Content-Disposition: attachment; filename="downloaded.pdf"');
// And fire the file
readfile('original.pdf');
//end
Reply With Quote
  #10 (permalink)  
Old 07-18-2008
The Natural Philosopher
 
Posts: n/a
Default Re: how to secure documents in server

RAZZ wrote:
> Hello, Can anyone suggest me solution?
>
> I Need to manage different types of documents (doc,xls,ppt etc) in
> server. I have folder structure to maintain these documents in server.
>
> Say folder1 is having all doc files; folder2 is having all xls files
> and so on.
>
>
> Now these documents should not be able to get access through the url
> by directly typing path.
> E-g if I try to access directly www.mywebsite.com/folder1/xyz.doc it
> will open the document in browser itself.
> At the same time these documents should be access only through our
> website once they are login. But without login also if you know the
> path you can get these documents how should I avoid it?
>
> How can I provide security to these documents in server?


Pur ALL thes documents as large BLOB objects in a database: thats one
easy place to store them and one access methodd needed to restrict
access to what you want.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:30 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0