Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File upload using bash(sh)

Status
Not open for further replies.

ry00

Programmer
Oct 28, 2005
2
NL
Hey all,

is there a way to upload files using CGI in bash? I have found loads of perl scripts, but I am not allowed to use those (its a school project I'm working on). And after attempting it myself, the file went corrupt (used sed). It really need to work in bash (or in C if bash is not possible).

Hope some1 can help me out.


Greets ry00
 
Hi

I am abit confused. Where will be the [tt]bash[/tt] script ? Client side ( it will upload the file ) or server side ( will receive the uploaded file ) ?

You said, already tried something. If is a CGI script, please post it. ( If is not huge. )

Feherke.
 
The script will be serverside. I just want to upload files from my website, without using ftp, or using any CGI/perl scripts.

I can not post the script I have at this moment, since it is but I can try to explain what it does.

When the file gets uploaded, it is streamed into sed. When it's done, the result of that will be saved as the new file.

The problem here is that sed does not read 0x00 bytes from files. They do not appear in the created file on the server.

I will try to post my CGI script asap.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top