Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6325267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:51:50+00:00 2026-05-24T16:51:50+00:00

Facebook and Google+ has both a great feature: Image preview. When you write in

  • 0

Facebook and Google+ has both a great feature: Image preview. When you write in URL of your web, images are taken and you can select between them – it’s done with proxy script.

My question is – Is there a way to reproduce same behavior BUT prevent users to insert links to big files which are expected to be HTML files? Proxy script could look like this

<?php
$contents = file_get_contents($_GET['url']); //problem is on this line - When $_GET['url'] is url to 5GB file, it will try to download it - How could I prevent it?
$images = preg_match_all('~img src="(.*?)"~', $contents, $images);
if ($images){
    echo json_encode($images[1]);
else 
    die('[]');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:51:51+00:00Added an answer on May 24, 2026 at 4:51 pm

    Issue a HEAD request, which is basically a GET but does not transfer any of the file’s contents. You can then extract the Content-length header and see how much data you WOULD be fetching had it been a GET.

    However, note that nothing prevents a malicious user from serving up two different sets of data – “this image is 10k” via ‘head’, and then serving up a terabyte of data via ‘get’. It’d waste their bandwidth as well as yours, but it is possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I know Facebook has embraced Open ID but I can't find the url
Lets say google.com has tags called: search,google,searchengine,engine,web Facebook has tags called: facebook,social,networking,friends,community How should
In DotNetNuke, the blog posts have a control that has icons for facebook, google,
I've been developing a Facebook app using Google App Engine in Python and the
Does Google force employees who have offers from Facebook to leave immediately?
I have a Python Facebook project hosted on Google App Engine and use the
Is it possible to place Facebook's request form inside a popup? Google is failing
I am just developing an a desktop application for Twitter, Buzz and facebook. Google
facebook has the facebook credit and I knew that they are testing on pay
Facebook has linked accounts, where facebook logs you into facebook everytime you are logged

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.