SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prevent File Save As

    As far as I know there is no way to do this but my boss thinks otherwise. On the website http://profile.keralamatrimony.com/search/search.php if you search using that form you are not being able to save files on IE 7. It says "This web page may not be saved correctly. Would you like to save anyway?". Does anyone know of a reason IE 7 behaves that way? Is it something that the website admin is doing? I highly doubt it is since Firefox has no problems saving the page. I think what it is is that IE 7 is resubmitting the ajax (dont know) and getting a blank response from the server or something. Can anyone fill me in on more why this website behaves that way and also if there is indeed a way to stop file save as.

    Thanks.

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no way to do that. I haven't heard of this before, but it seems like a feature of IE7. It doesn't prevent any body from saving the page - It just warns that the page may not work entirely as intended, if you do so.

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you try saving that page even though it warns it does not save. Do you know how that was accomplished?

  4. #4
    SitePoint Addict
    Join Date
    Jul 2008
    Location
    sudo rm -rf /
    Posts
    386
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See the source code of the page and analyze it.

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A solution may be to use AJAX, java, or flash?

    Or you could have javascript check the document url before displaying the page. This isn't foolproof but it would stop a lot of people.

  6. #6
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The site uses a lot of ajax. I am thinking they are somehow using it to prevent it from happening. Stumped on how though.

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you're trying to prevent a page from being saved? The simplest way to do this is like I said before using javascript to check the document URL. This wouldn't prevent it from being saved but would prevent most (but not all) users from being able to access that saved page.

    For example:
    onload use javascript to check the document URL. If it isn't your URL (meaning it's on the user's system) you can have javascript set the display of the page to "none". Most people here on sitepoint would be able to get around it but for the average joe the saved page would not work.

    Hope this helps

  8. #8
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He wants to prevent users from saving the images along with the page.

  9. #9
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well since the images have to be downloaded to the user's computer before the browser will display them, that is not possible. Of course you could use java or flash to display and protect the images (unless the user crops the images from a screenshot). That's why watermarks are used.

  10. #10
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Bloomington, IL
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got an idea for a program that will convert an image to a table. The table columns and rows would be 1px in size. The program would set the background color of the table cells to the color of the correlating pixel in the picture. I don't know how that would affect performance but it could work. Just something I've thought about.

    Again though the user could take a screenshot and cut out the picture, so it's not flawless.

  11. #11
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not worried about screenshots. Just downloading the page through file save as. I am blocking every other way (that my boss wants) except for save as.
    Last edited by PHP Monkey; Nov 19, 2008 at 08:45.

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    How are you blocking the browser from downloading the page to the browser cache without also disabling the browser's ability to display the page at all?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  13. #13
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He is only worried about the average joe user who only knows to right click, save as, and maybe view source. I have taken care of right click and view source (yes I know you can get around it) but like I said an average joe user will not. Also only interested in blocking users with IE from downloading this.

    When I said every other way I meant every other way that my boss wanted. Haha sorry.

  14. #14
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    I'd have thought that most people wanting a copy of the page would use the "Save As" option in the "File" menu in the menu bar (and that can't be blocked).

    Also anyone wanting to use right click to save things will have turned off the ability of web pages to disable it. Disabling right click only interferes with those people who use that menu to navigate between web pages and have the menu and toolbar at the top of their browser turned off. Disabling their only way of operating their browser and forcing them to close and reopen their browser in order to get around your block will get them extremely annoyed and have them telling everyone what a horrible site it is for not allowing them to leave.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  15. #15
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    How do you stop images being ripped?

    Watermarks.

    Besides, if someone wants an image that they couldn't download, they could always printscreen it.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  16. #16
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    I'd have thought that most people wanting a copy of the page would use the "Save As" option in the "File" menu in the menu bar (and that can't be blocked).
    The website I have listed above somehow had success in blocking it (either by error of the site's programmer or something else) in IE 7. My boss wants me to replicate the error or code and I have no idea how they did it. I know of what you say about the numerous ways you can get around it but I posted here to see if anyone can figure out a way to replicate that site. If you try to save as on that site after you have searched for a user it initially lets you and then IE says cannot be saved and errors out. The error does not exist in Firefox. Like I said he is only interested in blocking people using IE.

    I fully know and have told him AND have shown him all of the ways you can get around it but he wants our website to have the error or code that is causing IE 7 to error out on their website.

    If anyone has any idea how they are doing that please let me know.

  17. #17
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    I can save that page fine using IE7. Whatever is stopping it from saving for your boss must be something in the way his browser is configured.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #18
    SitePoint Zealot
    Join Date
    Oct 2008
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    I can save that page fine using IE7. Whatever is stopping it from saving for your boss must be something in the way his browser is configured.
    Thats really odd if thats the case. 3 computers in our office using IE 7 cannot save it. Let me try going home and seeing if I can save it there. I know forsure there is no custom configuration that I have set for IE 7 on this computer I am using. Are you saving the page as web page complete where it downloads the pictures too?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •