Solved

cgi

Posted on 2002-07-16
11
229 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
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 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)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

21 Experts available now in Live!

Get 1:1 Help Now