Sample Header Ad - 728x90

bash script curl upload files to php page

0 votes
0 answers
878 views
I am not sure that I am posting on the correct forum. I am working with Linux Centos 7 and I write a bash script which take all files with txt extension from a directory to upload them to the server with php. The bash script seems to find all files inside the directory but it upload only one file and at the end of the process my php page is deleted. My bash script: #!/bin/sh for filename in $(find /home/rico/mywebsite/ -maxdepth 1 -name \*.txt ) do echo ${filename} curl -O -X POST -F 'avatar=@'${filename} http://localhost/ions/uploadTXT.php done; and my php page is written like that:
Asked by user979974 (185 rep)
May 13, 2020, 09:51 AM