473,855 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding files from public access but viewable within domain

116 New Member

Not sure if this is the right place for this question so feel free to move it :)

I am building a system in PHP whereby PDF/XML files are uploaded to a remote server. These files should not be able to be publicly viewed (imagine this is a CHMOD issue).

However I need these files to show in an iframe or div within a PHP page on the same server.

I know I can put the files behind the public_html folder which is great but then how do I get the page on the domain to show the file in the iframe/div?

Jun 6 '14 #1
8 5575
8,658 Recognized Expert Moderator Expert
However I need these files to show in an iframe or div within a PHP page on the same server.
that statement doesnít make sense (at least to me).

for viewing something in a HTML page (an iframe ainít different from that) you need a client. the client is always on another machine (with localhost being the sole exception) Ö
Jun 7 '14 #2
13 New Member
Use .htaccess, give acces to local ip address, deny access from other IP address.
Jun 9 '14 #3
116 New Member
Thx for the replies and sorry for the late response.

@Dormilich - I understand that an iframe etc is still an html page in itself and that is the source of the problem - ie, the page must be able to be read to be shown in the iframe but not be publicly accessible...

@meditation - I'll give this a go and let you know shortly.

All the best to you both
Jun 11 '14 #4
8,658 Recognized Expert Moderator Expert
the page must be able to be read to be shown in the iframe but not be publicly accessible
impossible. an iframe is nothing more than a browser window inside a browser window, so the same rules as a "regular" browser window apply regarding resources.

another interpretation were that the data should be public, but not as a bare HTML page you could call. this calls for loading this content via AJAX i.e. you fetch the data (not the HTML representation of the data) from the server and make JS render/insert it into the current page. that could be an iframe, although that would be the most laborious way to render the data (since you need to create a complete page instead of just an HTML chunk)

These files should not be able to be publicly viewed (imagine this is a CHMOD issue).
why is that a CHMOD issue? one is about HTTP and the other about the filesystem.

nevertheless, if the PDFs/XMLs are available in your page, I don’t see why it shouldn’t be possible to extract them from there (unless you don’t serve it as PDF/XML but as HTML representation thereof).
Jun 11 '14 #5
116 New Member
OK Thanks.

Since no-one has suggested using the CHMOD on the folder containing the files I guess I'm looking at reading the PDF content into the page from a file location behind the public root.

I'll see how I get on with that.

@meditation - I think this would have worked but unfortunately the office does not have a static IP so is not feasible.
Jun 13 '14 #6
8,658 Recognized Expert Moderator Expert
Since no-one has suggested using the CHMOD on the folder containing the files
since CHMOD modifies the filesystem permission on the computer, it would make no difference who is accessing the resource from outside. it’s more like you either have access or not no matter who you are.

I guess I'm looking at reading the PDF content into the page
but you still need to tell the script whether the user viewing the page has the right to get that document served (e.g. via login).
Jun 13 '14 #7
project manager
10 New Member
Copy the content in temporary file and show the temporary file, delete it after sometime.
Jun 16 '14 #8
8,658 Recognized Expert Moderator Expert
that would still make it accessible from everywhere, though for a limited time.
Jun 16 '14 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Siemel Naran | last post by:
Do using declarations respect private, protected, public access levels? class A { public: void f(); private: void f(int); }; class B : public A {
by: Hank Reed | last post by:
For about a year I have been printing pdf files from Access 2000 using the ShellExecute Me.hWnd, "print", FileName, "", 0, SW_SHOWNORMAL We normally print, from 1 to 100 engineering documents in this way. Now I would like to intermingle (Collate) the pdf files with the Access reports: i.e. Access Report - pdf file - Access Report - pdf file When I loop though the list of reports - pseudo code here:
by: denisel | last post by:
Hi, We will be conducting surveys through SurveyMonkey online and will be importing the answers by tab delimited or comma delimited file into access. I was wondering if there is specific way to import delimited files into Access or Is there a specific way I should design the survey online so Access can recognize the file? Here is my table structure to give you an idea on where I'm coming from. Thank you so much in advance!!! ...
by: rlntemp-gng | last post by:
Looking for the "moderator" of the comp.databases newsgroup, I could not find one; (not sure if there actually is one). So I'll toss this one into the ring...... The other day I discovered that "microsoft.public.access" has 39 separate newsgroups under this one...from table design to macros to form design, etc) http://groups.google.com/groups/dir?sel=33606877&hl=en Understanding the the traffic on some of these newsgroups is little to
by: Chris | last post by:
How do we create digitally signed MDE files in Access 2007 ? I tried to follow the procedure I was using in other office versions. 1. I installed the Verisign certificate (with private key). 2. Signed the MDB from VBA. 3. Create the MDE. When I try to open the signed MDE, even on the developement machine with
by: 2good2b | last post by:
Is there any way to deny public access to the smarty TPL files? I checked my site and currently anyone can enter view the source of the TPL files by just surfing there. When I'm trying to change privileges the smarty system stops working I've been told the templates can possibly be moved to a directory not in www, is it possible? Thank you
by: rrrelic | last post by:
Can someone help me with this? I am running Access 2003 and attempting to import and append multiple XML files into Access. I currently do this process using the Import tool built into Accessís File menu. The only problem with this is that I have to do one file at a time and I have hundreds of files to import. I would like to be able to use code to loop through all the files contained within a specified folder and import and append the...
by: heiro | last post by:
Hi! Is their any ways of hiding files and folders using python?
by: HistoricVFP | last post by:
Hello, Iíve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with: External table is not in the expected format. (Error 3274) Iíve tried the following but it did not work: ďTo import data from a FoxPro database, use the Microsoft Visual FoxPro ODBC driver. To do so, follow these steps: 1. Click Start, and then...
by: Adrian Scott | last post by:
Here are two sample file Header ID DATE AMT DESCRIPTION 02 11/1/11 25 This is my descrption Header ID DATE AMT DESCRIPTION
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.