LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2011, 09:35 AM   #1
daedlock
LQ Newbie
 
Registered: Jul 2011
Posts: 5

Rep: Reputation: Disabled
upload a file with cgi C


Hello,

I am new at these topics and i am trying to upload a file with cgi. I have an html code like below :

<table class=upload>
<form method='POST' enctype='multipart/form-data' action='upload.cgi'>
<input name=upfile type=file ><br>
<br> <input type=submit value=Press> to upload the file!</form>
</table><br>

I am trying to get the file with upload.cgi and execute a linux command in linux but i do not know how to. I use C code for that. Can you help me,please? How can i know the file from html in cgi C code?
 
Old 07-13-2011, 05:37 AM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
With C, I recommend using the qDecoder (version 11 or later, as the API has changed a bit). They have a working file upload example, uploadfile.c. I recommend starting with that one since it streams the uploaded files directly to disk, and therefore uses much less memory on the server. The other example, upload.c, reads the file(s) into RAM first.
 
Old 07-14-2011, 07:12 AM   #3
daedlock
LQ Newbie
 
Registered: Jul 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you for your reply.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
upload .cgi file to web page aocferreira Programming 2 04-21-2011 11:26 PM
upload in perl/cgi shifter Programming 12 03-18-2010 03:35 PM
Upload file to ftp server -vsftp- but can not delete or change the file once uploaded murattas6 Linux - Server 2 06-26-2009 06:00 AM
perl CGI full path to file for upload GATTACA Programming 1 06-11-2007 10:42 PM
web server (fedora core 5) became read-only file system after i upload a file nggs8411 Linux - Server 1 03-26-2007 09:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration