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 930135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:17:14+00:00 2026-05-15T20:17:14+00:00

Is there a way in PHP use a HTML form to upload only the

  • 0

Is there a way in PHP use a HTML form to upload only the header of the file. The length of the header is defined within the first few bytes of the file, I want only that part nothing else. After I have received the last byte of the header, I don’t want any more of the file. Is there a graceful way to do this in PHP or am I going to have to do some socket programming?

  • 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-15T20:17:15+00:00Added an answer on May 15, 2026 at 8:17 pm

    In the PHP side, you cannot abort an upload (HTTP connection) gracefully. The client would face a “connection reset by peer” error (or whatever friendlier flavored message the webbrowser made out of the error). Best what you can do is to ignore the read bytes, but that’s not (clearly?) easy in PHP since it’s a pretty high level language.

    In the HTML side, there’s absolutely no way to upload only the “header” of a file. It’s the complete file or nothing. There are countless different file formats and HTML has no notion of any of them, let alone know how to distinguish the “header” part of the file in question.

    Your best bet is to write a little application which get served by the webpage and downloaded into client’s machine and runs locally over there. This application should have a file chooser/picker/opener and then programmatically determine the “header” and send it to the server. You could do that in flavor of a Java Applet or MS Silverlight or probably Adobe Flash.

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

Sidebar

Related Questions

Is there a way to use the die() function to stop executing PHP statements
Normally we use window.location.href=/index.php?querystring; in javascript. Is there a way to send the querystring
Is there any way to include php file using require and calling a php
I have a php file that contains a HTML form, then PHP logic, then
this the condition: there is a form in html and php haivng around 120
I've got a page where users can upload a HTML file for use as
Is there a way with PHP to show 2 (or x) decimal places, but
Is there a way in PHP 5.3 to get crypt() blowfish (salt starting with
Is there a way in php to count how often a value exists in
I was wondering is there a way in PHP that you could tell where

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.