Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question