Answer the question
In order to leave comments, you need to log in
What PHP script is needed to upload a file to the server?
There are a lot of examples on the Internet of how you can upload a file, but they all use an html form to do this. And I now need to upload a file to the server from a Java program. Those. The Java program creates an output stream and sends the file to the server by calling the script. And here the script must somehow process this incoming stream and, having collected it in a file, save it where I need it.
I don't know how to write such a script. Yes, I don’t know what there, I don’t understand much in PHP at all. I thought, maybe someone will be so kind and push me in the right direction, articles where this has already been implemented? Or maybe someone has already encountered such a problem?
Is it really possible to transfer a file without a form?
PS I would write the server part in Java, but the server does not allow it. And please do not write, they say, change the server! I can't and that's it... (
Answer the question
In order to leave comments, you need to log in
What PHP script is needed to upload a file to the server?
If you will be transferring a file, you will need to transfer the appropriate header.
Well, if you do everything correctly, then your file will be located on the server in the $_FILES global array.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question