Solved

cgi

Posted on 2002-07-16
11
228 Views
Last Modified: 2013-11-18
how can i create a file from cgi?
0
Comment
Question by:shaza
11 Comments
 
LVL 7

Expert Comment

by:Cynna
ID: 7156900
??

More details please...
0
 
LVL 17

Expert Comment

by:geobul
ID: 7157033
Using FileCreate or Rewrite for example.

Regards, Geo
0
 

Author Comment

by:shaza
ID: 7158776
i used tfilestream to create a file in harddisk but it didn't work well........
0
 
LVL 2

Expert Comment

by:lortega
ID: 7161216
you need to configure your web server to allow
your CGI to access the Hard driver... You will
probably have to create an account and them
assigned to your CGI...

Luis
0
 

Author Comment

by:shaza
ID: 7161399
how can i allow my cgi access hard driver?!!!!!!!!
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 17

Expert Comment

by:geobul
ID: 7161419
Give us some more details: WebServer type (IIS, PWS, etc.) and that part of your code where you are creating your file.

I use IIS on Win2000/NT4, CGI and ISAPI programs written in Delphi 5 and have no problems accessing the local/remote(LAN) file systems. Paths to local files are given as in any usual (non-CGI) app.

Regards, Geo
0
 

Author Comment

by:shaza
ID: 7161430
I use IIS on Win2000, CGI  programs written in Delphi 6
**********
 var
  fname,fpath,str,str1:string;
  {f:file of char} i,FHANDLE:integer;
  f:TFileStream;
  t:text;
begin
   fname:=Request.ContentFields.Values['fname'];
   fpath:=Request.ContentFields.Values['fpath'];
   str:= ''''+fpath+'\'+fname+'''';
   str1:=Request.ContentFields.Values['scbox'];
   assignfile(t,str);
   rewrite(t);
    write(t,'str1');
   close(t);

/////or using filestream
//f:=f.Create(str,fmCreate);
//f.write(str1);
//f.close
   
0
 
LVL 17

Accepted Solution

by:
geobul earned 50 total points
ID: 7161438
I think that it should be:
str:= fpath+'\'+fname;

Regards, Geo
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7166154
Geo is right about the file name.

I haven't fully read everyone's reply but you need to configure the web server to allow write permissions to the directory where you are wanting to write to the file.  NOTE!  the permissions must allow the anonymous user rights to write.  This is because all CGI applications are executed under the permissions under which the CGI application ran.  In our case I needed to make permissions so the user IUSR_WWW would have Write permissions to our Logs directory...

You may also consider making a tiny app which is super-protected to detect and diagnose any permissions problems.  That can save very much time.  I should have made one much earlier than I did!  It's kind of a "doctor" which verifies that everything necessary works as it should.
0
 

Expert Comment

by:CleanupPing
ID: 9343055
shaza:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9460966
shaza,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to geobul http:#7161438

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now