在PHP中从用户的计算机上载文件时保留本地文件路径副本的最佳方法是什么

I am writing a batch uploader. The client app allows the user to drag a directory of files (including subdirectories) to be uploaded to the server. My aim is to replicate the local directory structure on the server.

I don't intend to 'actually' create the same directory structure. I will use some sort of reference in the DB to keep track of it. However, when I upload the file I would like PHP to have access to its original file path on the local machine.

I am open to a simple way (some sort of string reference), but I understand a multi-step strategy (upload a 2cd array of local paths?) might be required. I'm looking for advice on the best way to approach the problem rather than a line for line solution.