Loading a file into a PHP script using Curl and Bash scripting -
having foo.txt file, i'm trying load php script using curl , bash script.
foo.sh, foo.txtand foo.phpare under same folder:
/var/www/foo/ the foo.sh bash script:
#!/bin/bash curl --form "fileupload=@foo.txt" http://localhost/foo/foo.php the foo.php script:
<?php echo "foo line"; var_dump($_file); exit; when execute bash script:
./foo.sh the foo.php script shows foo line message, regarding file, gives following error message:
undefined variable: _file in /var/www/foo/foo.php on line 3 any suggestions?
if there way load file $_file variable using php (via terminal), solve problem.
it $_files (so should add "s")
Comments
Post a Comment