PHP File Upload to remote server
Moderator: General Moderators
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
PHP File Upload to remote server
Hi Friends,
This is my first post in the forum.
I am working on a healthcare web application being developed in PHP. We have a functionality where the user would upload the files and they should be stored on a remote server. In short the uploaded files should be stored on a remote server and should be retrieved from there.
Can you please let me know how to achieve this in PHP.
Your help is greatly appreciated.
Thank You
Kishore
This is my first post in the forum.
I am working on a healthcare web application being developed in PHP. We have a functionality where the user would upload the files and they should be stored on a remote server. In short the uploaded files should be stored on a remote server and should be retrieved from there.
Can you please let me know how to achieve this in PHP.
Your help is greatly appreciated.
Thank You
Kishore
Re: PHP File Upload to remote server
I'm actually looking for a similar solution. One would be using the PUT-request to transfer the file (upload it to the server) then using GET-request to start the file download. I'm guessing you do not want the user to handle directly to the file server thus the script would work as a proxy.
Re: PHP File Upload to remote server
I made one of these a while ago using curl. It's pretty easy...just read up on curl.
You can check mine out on my site...it's in the options for posting/sending messages. I don't like to host uploaded files on my own server (for bandwidth and security reasons) so I upload uploaded files to a file host server.
If you have any specific problems I'd be happy to help.
You can check mine out on my site...it's in the options for posting/sending messages. I don't like to host uploaded files on my own server (for bandwidth and security reasons) so I upload uploaded files to a file host server.
If you have any specific problems I'd be happy to help.
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
Re: PHP File Upload to remote server
Thank you guys for taking your time off and posting the replies
Can you please let me know the curl code to upload file to server. Does this require any install of the software (any library files).
I have reviewed the PHP documentation but could not get much out of it..
Thanks for all your help
Kishore
Can you please let me know the curl code to upload file to server. Does this require any install of the software (any library files).
I have reviewed the PHP documentation but could not get much out of it..
Thanks for all your help
Kishore
Re: PHP File Upload to remote server
Is it necessary to use PHP?kishore_marti wrote:Can you please let me know how to achieve this in PHP.
A simple call to "scp" or whatever remote copy command (these are for Linux) is simple enough.
There are 10 types of people in this world, those who understand binary and those who don't
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
Re: PHP File Upload to remote server
Hi Friend,
Thanks for your suggestion.. We are working on a project being developed in PHP where uploading files is one of the functionality.. So this has to be done in PHP.
Please let me know if the scp command that you mentioned can somehow be executed through PHP..
Thanks
Kishore
Thanks for your suggestion.. We are working on a project being developed in PHP where uploading files is one of the functionality.. So this has to be done in PHP.
Please let me know if the scp command that you mentioned can somehow be executed through PHP..
Thanks
Kishore
Re: PHP File Upload to remote server
http://us3.php.net/manual/en/function.ssh2-scp-send.php
Code: Select all
$conn = ssh2_connect('ssh.server.com', 22);
ssh2_auth_password($conn 'user', 'pass');
ssh2_scp_send($conn, '/local/filename', '/remote/filename', 0644);There are 10 types of people in this world, those who understand binary and those who don't
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
Re: PHP File Upload to remote server
Thanks for your reply
Can you please let me know where can i download php_ssh2.dll. I couldn't find one in PHP site
Thanks
Kishore
Can you please let me know where can i download php_ssh2.dll. I couldn't find one in PHP site
Thanks
Kishore
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
Re: PHP File Upload to remote server
Thanks for the reply.
I really like the prompt response that I am getting here..
I will try the options mentioned above and let you know..
I thank all of you guys..
I really like the prompt response that I am getting here..
I will try the options mentioned above and let you know..
I thank all of you guys..
-
kishore_marti
- Forum Newbie
- Posts: 8
- Joined: Thu Jul 09, 2009 6:10 am
Re: PHP File Upload to remote server
Friends,
I tried connecting to FTP server through PHP ftp_connect and transfer files there using ftp_put.. but i am receiving the "Could not create file" exception when the command ftp_put is executed.. I have verified the status of the connection and it is able to connect to ftp server.. but not able to transfer files to server..
Can you please help me out in this issue..
Thanks
Kishore
I tried connecting to FTP server through PHP ftp_connect and transfer files there using ftp_put.. but i am receiving the "Could not create file" exception when the command ftp_put is executed.. I have verified the status of the connection and it is able to connect to ftp server.. but not able to transfer files to server..
Can you please help me out in this issue..
Thanks
Kishore