P
P
Peter2013-12-17 13:45:41
PHP
Peter, 2013-12-17 13:45:41

How to organize the upload of a file from the admin panel hosted on one hosting to another hosting, where the site is located?

Greetings.
The site is spinning on one hosting. There is also a DB.
Admin on another hosting.
There are no problems with writing to the database. How to organize a file upload from the admin panel to the hosting where the site is located?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
TekVanDo, 2013-12-17
@Alcospb

Send files via curl blog.webmasterschool.ru/php/112

M
maxaon, 2013-12-17
@maxaon

If you need to immediately upload files to another domain, bypassing intermediate servers, you can use uploading via JS (You can even just make a form, it will also work).
If you want to do it via JS, you can use Plupload . In order for POST to another domain to work, use CORS by setting the "Access-Control-Allow-Origin" header in upload.php .
You can even use the same code that is on your main domain by simply adding a title.

V
Vit, 2013-12-17
@fornit1917

For example: FTP or NFS or via an HTTP request (i.e. you upload a file to the admin panel, and in the admin panel code you make another request via file_get_contents and stream_context or curl, in which you upload the file to another machine with the site, on the site you accept it and save where necessary).
I would choose FTP or HTTP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question