PHP - Resume File Upload

Posted on 2005-03-12
Medium Priority
Last Modified: 2008-03-10
I'm trying to add a resume function to a program I'm creating. Right now it it uploads the file to /tmp (by the php.ini settings) then moves the file into a specified directory.

My problem is if the file was 6mb I need a way to resume the previous file transfer so that if it times out half way they don't have to start all over again.

I've thought of spawning a server side script that just moves the file in /tmp to another temporary place and have that as the file it will resume but it just doesn't sound that practical to me. Any ideas?

Question by:Shroder
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
LVL 25

Expert Comment

by:Marcus Bointon
ID: 13536518
I'm not aware of web browsers supporting resuming uploads at all - downloads they can do as it can be implemented entirely on the client side, but the client has no idea where to resume an incomplete upload. You may be able to do it with FTP, which has slightly more resuming features:


Author Comment

ID: 13566551
They aren't using a web browser. The client side is a VB application I'm creating.

As of now I just have the client sending a chunk of data at a time so if the connection times out there's a resume function. I'm trying to see if there are any other options.

Author Comment

ID: 13566713
Do you have any references to show me how to launch function from links with the label component?
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.


Author Comment

ID: 13566716
opps. Wrong topic. Nevermind.

Author Comment

ID: 13957188
The solution I found for my problem:

I created several functions in my VB application that took segments of data from the file being uploaded and sent them to the PHP file. The php file was recoded to append the file on the server with the new data instead of taking it all in one session.

If the connection was cut off some how the VB app could then send a resume request to another PHP file, receiving the resume point, and begin uploading the rest of the file.

Accepted Solution

Lunchy earned 0 total points
ID: 13988599
Closed, 500 points refunded.
Friendly Neighbourhood Community Support Admin

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question