Hello there,
I need a help from the php experts. I need a script to upload image from my server to a different server as in pictiger.com. Please anyone help me to get this script.Do you mean upload the file to your server first, and then transfer it to another server? For that you'll probably want to do a normal upload, and then FTP/SFTP (<!-- m --><a class="postlink" href="http://www.php.net/ftp">http://www.php.net/ftp</a><!-- m -->) the file to the other server, or that would be what I'd do.
Or do you mean save a file to your server from a remote URL? For that, you can use file_get_contents to read the remote image into a string, and use file_put_contents to save it to a local file.Do you mean upload the file to your server first, and then transfer it to another server? For that you'll probably want to do a normal upload, and then FTP/SFTP (<!-- m --><a class="postlink" href="http://www.php.net/ftp">http://www.php.net/ftp</a><!-- m -->) the file to the other server, or that would be what I'd do.
Or do you mean save a file to your server from a remote URL? For that, you can use file_get_contents to read the remote image into a string, and use file_put_contents to save it to a local file.
Hi,
Thanks for your reply.
Let me explain you.
I am developing a script that the user will upload the images to the site. From their member section there need to be option to upload the image to their server ( not through ftp or other) through php script.
Please let me know if you get clear about this thingsconfused, when you reffer to there site is this a different location to the server, or is there site hosted on the server?Hey,
I'm looking for a solution to a similar kind of problem as phpbaby.
Let's see if I can explain it...
I have a website and PHP script already set up that allow users to upload images from their computer onto my website's server. Now that their images are sitting pretty on my web server, I want them to have the option of sending that uploaded image via a "post" method to ANOTHER server that already has a script set up to upload files sent via "post." Neither myself NOR my users have the ability of editing any files on this other server, but it DOES allow other websites to post content to it.
Thus, users will be able to upload their file to another server without having to select the file from their hard drive again.
I found an ASP script that does what I've described (<!-- m --><a class="postlink" href="http://www.codeproject.com/aspnet/TransferFilesWebserver.asp">http://www.codeproject.com/aspnet/Trans ... server.asp</a><!-- m -->), but I need the same functionality in PHP. I've tried searching for it, but none of my searches have been successful and I'm a bit stumped now.
If anyone could help me with this, I'd greatly appreciate it!
Also, a word to phpbaby: you should probably check out doing what you have described via FTP, since that seems much more straight-forward than setting up a PHP script on your webserver to send files, and ANOTHER script on the receiving webserver(s) to receive the files (your users would probably be more willing to type in some FTP information than setting up and uploading a file to their server).Sounds like a job for cURL.Thanks a lot!
I think this does the trick for me: <!-- m --><a class="postlink" href="http://us3.php.net/manual/en/function.curl-setopt.php#24709">http://us3.php.net/manual/en/function.c ... .php#24709</a><!-- m -->
Don't know if phpbaby's set, though...
I need a help from the php experts. I need a script to upload image from my server to a different server as in pictiger.com. Please anyone help me to get this script.Do you mean upload the file to your server first, and then transfer it to another server? For that you'll probably want to do a normal upload, and then FTP/SFTP (<!-- m --><a class="postlink" href="http://www.php.net/ftp">http://www.php.net/ftp</a><!-- m -->) the file to the other server, or that would be what I'd do.
Or do you mean save a file to your server from a remote URL? For that, you can use file_get_contents to read the remote image into a string, and use file_put_contents to save it to a local file.Do you mean upload the file to your server first, and then transfer it to another server? For that you'll probably want to do a normal upload, and then FTP/SFTP (<!-- m --><a class="postlink" href="http://www.php.net/ftp">http://www.php.net/ftp</a><!-- m -->) the file to the other server, or that would be what I'd do.
Or do you mean save a file to your server from a remote URL? For that, you can use file_get_contents to read the remote image into a string, and use file_put_contents to save it to a local file.
Hi,
Thanks for your reply.
Let me explain you.
I am developing a script that the user will upload the images to the site. From their member section there need to be option to upload the image to their server ( not through ftp or other) through php script.
Please let me know if you get clear about this thingsconfused, when you reffer to there site is this a different location to the server, or is there site hosted on the server?Hey,
I'm looking for a solution to a similar kind of problem as phpbaby.
Let's see if I can explain it...
I have a website and PHP script already set up that allow users to upload images from their computer onto my website's server. Now that their images are sitting pretty on my web server, I want them to have the option of sending that uploaded image via a "post" method to ANOTHER server that already has a script set up to upload files sent via "post." Neither myself NOR my users have the ability of editing any files on this other server, but it DOES allow other websites to post content to it.
Thus, users will be able to upload their file to another server without having to select the file from their hard drive again.
I found an ASP script that does what I've described (<!-- m --><a class="postlink" href="http://www.codeproject.com/aspnet/TransferFilesWebserver.asp">http://www.codeproject.com/aspnet/Trans ... server.asp</a><!-- m -->), but I need the same functionality in PHP. I've tried searching for it, but none of my searches have been successful and I'm a bit stumped now.
If anyone could help me with this, I'd greatly appreciate it!
Also, a word to phpbaby: you should probably check out doing what you have described via FTP, since that seems much more straight-forward than setting up a PHP script on your webserver to send files, and ANOTHER script on the receiving webserver(s) to receive the files (your users would probably be more willing to type in some FTP information than setting up and uploading a file to their server).Sounds like a job for cURL.Thanks a lot!
I think this does the trick for me: <!-- m --><a class="postlink" href="http://us3.php.net/manual/en/function.curl-setopt.php#24709">http://us3.php.net/manual/en/function.c ... .php#24709</a><!-- m -->
Don't know if phpbaby's set, though...