Jump to content

Can PHP running on server upload a local file without INPUT/file?


Recommended Posts

I'm writing a program.php file that will be located on a remote server. Its purpose is to upload local files. More specifically, I would like to upload an extremely large file from my client's local computer running Windows XP by having them run any modern browser and browsing to program.php.

 

I don't want to use the ordinary <input type=file ... /> uploading mechanism because it can't handle the size of the file (the server, not under my control, has a 2M size limitation, and there are other size limitations).

 

The problem I am facing is that "local" to PHP means the server, and "local" to FTP also means the server. But I want to upload a file from my client's local Windows computer, which does not have PHP or an FTP server installed.

 

I'm thinking I might do this with local scripting somehow, or by calling some Windows API from Javascript located in program.php. Maybe there is a better way than this, but I have no idea what it might be.

 

Has anyone solved this problem before, or have a really good idea of how this can be done?

 

Thanks!

 

David Spector

Springtime Software

 

Yes, of course javascript is sandboxed to prevent access to the local machine. However, its object model contains Windows file system and other objects that expose many aspects of the local machine. So, it may be possible to upload and download files (with the user's permission) using javascript.

 

Your Java examples are interesting, but I'm not willing to learn Java to solve this problem.

 

Perhaps I can write a very short executable program (in C++) or COM object (in C++) and install it locally. Then perhaps the local IP address could be passed to the server code. Can the server code use that address to call the local machine to upload or download the file?

 

I have these vague ideas, but no concrete knowledge to move forward.

 

Can anyone help?

 

Thanks,

 

David

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.