?
Solved

PHP - Resume File Upload

Posted on 2005-03-12
7
Medium Priority
?
1,302 Views
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?

Thanks!
0
Comment
Question by:Shroder
  • 4
6 Comments
 
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:

http://www.php.net/manual/en/function.ftp-nb-continue.php
0
 

Author Comment

by:Shroder
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.
0
 

Author Comment

by:Shroder
ID: 13566713
Do you have any references to show me how to launch function from links with the label component?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Shroder
ID: 13566716
opps. Wrong topic. Nevermind.
0
 

Author Comment

by:Shroder
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.
0
 
LVL 2

Accepted Solution

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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

569 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