473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

To create a text file in local macine from website..

( all in my websites) I am opening a database (stored in ftp -- ms access database) ..
after retrieving i want to write to a file in local machine... (something .. c:\test.txt)

its work fine while i am running in local host.. but in net .. its showing error...

i want to know if i want to create a file.. from website.. whether i have to provide any permission.. (security concern)

please answer
regards
ela
.

MY coding is....
Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.          Set fs = CreateObject("Scripting.FileSystemObject") 
  4.          Set wfile = fs.CreateTextFile("c:\myfile.txt", True) 
  5.  
  6.  ------------this database in ftp
  7.  
  8.      call opendatabase()
  9.            Set rsftp= con.Execute("select * from sendsms")
  10.            While not rsftp.Eof 
  11.               msg=rsftp.fields("col1")
  12.               sender=rsftp.fields("col2")
  13.  
  14.            'wfile.Write (msg)
  15.            'wfile.Write (sender)
  16.                   rsftp.movenext
  17.            wend
  18.  
  19.    Conloc.Close()
  20.    call closedatabase() 
  21.  
  22.  
  23. %>
Oct 22 '07 #1
2 1847
JamieHowarth0
533 Expert 512MB
Hi Elavarsi,

You need to create a text file that will be held in session and then use a download stream to stream the text file to the browser, as your current code is set to try and save the text file to your web server's C: drive which will be completely blocked as standard.

This article explains how to use the following code to force the web browser to download a file:

Expand|Select|Wrap|Line Numbers
  1. Response.AddHeader("content-disposition:attachment;filename=temp.txt")
  2.  
The browser will recognise it as an attachment and prompt the user to save the file to their hard disk. For security purposes there is no way of automatically saving a file using ASP to a user's hard disk, otherwise very malicious individuals could use it to automatically download viruses to your PC.

Best regards,

medicineworker
Oct 22 '07 #2
clain
79
in no way you can save a text file from wesite....

if that was possible then .... ooops what will be the securty for your pc?
Oct 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mark | last post by:
How can I programmatically discover the IP address of the computer on which my assembly is executing? Thanks.
0
by: lewi | last post by:
I am try to get in ASP.NET developement and I got IIS 5.0 and VS.NET 2002 on Windows 2000 Server... I created a new website(index.asp - just text without HTML/ASP tags - works in IE) in IIS and...
3
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
3
by: DBLWizard | last post by:
Howdy All, Is it possible to have Visual Studio 2005 create a project form an existing hosted website? In other words I want to be able connect via ftp to my website structure and have it pull...
16
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an...
5
by: =?Utf-8?B?TGVvbg==?= | last post by:
Hi Everybody. I am running VS 2005 with Service Pack on Windows 2003 server. All I was trying to do is to create a new website. I am getting an error message: Unable to create the Web...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
2
by: John_Doe | last post by:
Can anyone clarify what the difference between these two choices is when developing website? I have IIS installed too, so I can pick this too if there is a reason. From the point of view of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.