PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 14, 2022

[FIXED] How to upload the files using HTTP and and command line tools?

 January 14, 2022     command-line, file-upload, lamp, php     No comments   

Issue

I have a LAMP server. I have only Http(80) and HTTPS(443) ports are open. The users can upload files using PHP form. Some users are downloading files using wget. Are there way to upload files using command line tools?

thank you beforehand.
Arman

SOLUTION(thanks to R. Bemrose)
using the libcurl One can upload files from command line:
nice tutorial: http://www.maheshchari.com/upload-image-file-to-remote-server-with-php-curl


Solution

The curl library has a command line tool. I forget the exact options to do it, but curl can be used to post files as if it were from a form.

Edit:
The appropriate option seems to be -F "fileFieldName=@/path/to/file;otherField=otherValue;moreFields=moreValues"



Answered By - Powerlord
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing