Solved

cgi

Posted on 2002-07-16
11
230 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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
 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Microsoft Edge 9 99
Select distinct 25 100
enhance the following code 3 32
How to link a specific Wordpress Post directly to the main domain (no category!) 12 60
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 code hide show and toggles. 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…

777 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