HomePHP Page 2 - Merging a File Split for FTP Upload using PHP
Finding the file to be split - PHP
This is the second part of a tutorial on file splitting during an FTP upload. In this part, you will learn the details of file merging and implementation. The split PHP script was thoroughly discussed in the first part. It is highly recommended that you read that part to easily understand this one.
Sometimes it is difficult to detect the exact file name and extension. In that case you will need to use the Windows DOS command prompt and navigate to the XAMPP htdocs directory.
For example, if the file to be split is located in C:xampphtdocssplitfolder in your Windows-based operating system, go to Start -> Run -> and type CMD in the DOS prompt. After that, type EACH of the following commands to navigate to the split folder and then press ENTER:
CD (press enter)
CD XAMPP (press enter)
CD htdocs (press enter)
CD splitfolder (press enter)
DIR (press enter)
At the end of this command, you will see the list of files inside the “splitfolder” directory:
It confirms that the exact file name and extension is “test.mp3.”
Use this method to find the exact file name and file name extension.
After everything is set, click the button labeled “Split this large file into parts which is less than file upload limit.”
The file is automatically split into parts, and this will be displayed on the form. You will get a message telling you that the file has been split successfully. You will also be given details which you'll need to use when you merge the files. In our example, the filename to be used for merging should be test.mp3, and the number of parts after the split should be 12.
The script gave the 12 parts that were created by the split the filenames splited_0, splited_1, splited_2, etc. These can be found in the split folder directory. At this stage, the file splitting process is complete.