[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

cgi

Posted on 2002-07-16
11
Medium Priority
?
238 Views
Last Modified: 2013-11-18
how can i create a file from cgi?
0
Comment
Question by:shaza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

649 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