rhavendc rhavendc - 11 months ago 69
PHP Question

Live Program Accessing Local Files

I have a system running live on web and planning to make a contact to a specific computer. The system is going to access a file to that computer. Locally (via localhost), I can do it by this code:

try {
$file = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\SampleFolder\SameplFile.mdb;Uid=SampleId");
} catch (PDOException $e){

That code is not working anymore when the system is live because the folder address is not existing anymore in the hosting site. I'm using PHP but it's okay if you will suggest other languages to use (but of course, the language that will not substitute my whole PHP codes)

How to access that file securely? Can someone help me or direct me to the right guide site? Is this thing possible to achieve

I think I'm lost of words on how to query this kind of question in some search engines. I'm not sure either if using VPNs is the only must thing or just a part of doing the access or it's not related at all to this thing.

[ ! ] If the stated situation above is still not clear, this is the other version: I have a PHP program running on webserver. If it's possible, I like that program to fetch a file from a local computer.

Answer Source

Okay. The solution so far I got is by using the machine's Public IP Address. I made some minor re-coding and setting-up the machine's specifics and location.

Do you think that's all fine? If you guys have a better solution than this, you're welcome to share your ideas.