shaza
asked on
cgi
how can i create a file from cgi?
Using FileCreate or Rewrite for example.
Regards, Geo
Regards, Geo
ASKER
i used tfilestream to create a file in harddisk but it didn't work well........
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
your CGI to access the Hard driver... You will
probably have to create an account and them
assigned to your CGI...
Luis
ASKER
how can i allow my cgi access hard driver?!!!!!!!!
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
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
ASKER
I use IIS on Win2000, CGI programs written in Delphi 6
**********
var
fname,fpath,str,str1:strin g;
{f:file of char} i,FHANDLE:integer;
f:TFileStream;
t:text;
begin
fname:=Request.ContentFiel ds.Values[ 'fname'];
fpath:=Request.ContentFiel ds.Values[ 'fpath'];
str:= ''''+fpath+'\'+fname+'''';
str1:=Request.ContentField s.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
**********
var
fname,fpath,str,str1:strin
{f:file of char} i,FHANDLE:integer;
f:TFileStream;
t:text;
begin
fname:=Request.ContentFiel
fpath:=Request.ContentFiel
str:= ''''+fpath+'\'+fname+'''';
str1:=Request.ContentField
assignfile(t,str);
rewrite(t);
write(t,'str1');
close(t);
/////or using filestream
//f:=f.Create(str,fmCreate
//f.write(str1);
//f.close
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
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.
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.
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
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
More details please...