Manoj_amatuer
Manoj_amatuer

Reputation: 1

Filesplitter using .php

i m designing a website where users upload file, but the free webhost provides us only 3mb per file limit, so can i design a filesplitter using .php which splits a file(>3mb) into 3mb chunks and then while downloading; it re-assembles file into 1 piece

Is that possible? is that in scope of .php

Upvotes: 0

Views: 373

Answers (2)

Vinoth13
Vinoth13

Reputation: 397

Using splitthisfile(), we can split a file for a given size using php.. and u can read those file continuously by creating a separate folder and placing related split files.. u can get it clear in following link,

Url for split and embedding file.....

Upvotes: 0

Alex
Alex

Reputation: 14628

Yes, it is possible. You can even use this class: http://www.phpclasses.org/package/3231-PHP-Split-and-join-files-in-multiple-pieces.html

but there's nothing complicated in it, so you could write your own, for the sake of it. Just read through the functions like fopen, fwrite, fread, fclose. Those are all you need for this. http://www.php.net/manual/en/ref.filesystem.php

BUT, this won't solve your problem. Files are stored somewhere temporarily upon upload. You can't do nothing with it. PHP handles them internally and then gives them to your script afterwards.

Upvotes: 1

Related Questions