This is unlikely, horizon. You can test DOWNLOAD speeds this way -- it's fairly easy -- but UPLOAD speeds are practically impossible to measure.
Browsers are forbidden from providing OS informaton about the user's computer. So you don't know what files the customer has, ergo you can't upload a test file.
The browser user must use a file submit form to allow access to a single file for upload. So unless you explicitly ask the user to download a file of a specific size (which would require a download/save dialog), then ask the user to find and upload the same file, you won't be able to test upload speed. Which is not, by the way, the same as download speed, not by a long shot.
For my part, I'd rather just press the upload button and hope for the best than to download and then to upload a test file to see if your PHP program can then calculate the speed with which my file will be uploaded.
Since you won't know the SIZE of the upload file UNTIL IT HAS BEEN UPLOADED (another browser limitation) you will not be able to estimate how long the upload will take. You could only estimate the upload rate, not the ultimate elapsed length of time required.