Using the HttpRequest object to gather material (potentially from an
external server), is it possible to write the response stream into which
ever file type is required e.g. I request not just text, but an image - is
is possible to write the image to file? Or is this just not possible? I can
only find reference to create a text file.
For a while I am working with ThumbsPlus ( http://www.cerious.com/ ) as manager for pics. The benefit of the program is that it stores all kind of information in a central Microsoft Database that easily can be manipulated. A thumbnail of the picture is also stored in de MDB as long binary (jpeg format)
I made a small script that extracts all kind of information of the MDB by use of queries and ASP. This works perfect for string/numerical information.
I am wondering if I can also write the stored (jpg)thumbnail to the asp file so that I have a preview of my picture.
Can this be done? What is the syntax?
I tried already:
Response.BinaryWrite BinData
Where BinData is the contents of the Thumbnail field. When I take a look at the MDB table in design view, the DataType of this field is "OLE object", if I open the table, the contents of the field displays "long binary data".....
I want to write few lines to one file called log.txt. This log.txt is located in one directory called log.dir This log.dir is located in webroot (mysite.com/log.dir/) I protected this directory using password protection from my hoting control panel. So if I want to see log.txt file using browser, I have to enter username and password. It works fine.
I have a asp file in webroot called my.asp This file writes some text in log.txt file. I tested this using firefox browser. All worked fine. You may wonder, where is the problem then? The problem is Internet Explorer. When I tested my.asp file using IE, it asks for username and password to proceed further. I want to avoid this.
How can I write to a file located in password protected directory that will work with IE? I know it look stupid. ASP work on server side so it should work with IE if it works with FireFox. But trust me, it's not working .
Im getting a error when trying to write to a txt file.Its so annoying i got it working on my test server and then moved it to another server and it gives this error i think it could be perrmisions but ive gave the folder read write permisions.
I'm having trouble translating a script that I wrote in php to asp. Well a line any how.
$fp = fopen("/mydomain/logs/mail.log", "a+") or die("Could Not Write Form Data To File.");
fputs ($fp, $info_from_form);
fclose($fp);
basically, the above line does is:- opens the file mail.log and writes to the content of that file. the "a+" means that if the file is not there then it will create "mail.log" and write to it.
The process was included in a form to email php script.
When I run an asp script, I can view the contents on the screen in pdf format. But instead of displaying the information to the screen, I want to be able to save the same information into a binary file with a pdf extension. Does anybody know how to do that?
I have listed the coded that writes it to the screen, but now want to be able to write the information into a file ....
Client said "Yea, our current host does PHP and all that" and of course they don't. I know PHP, so hopefully it is somewhat similar to ASP. Anyway...I want to know how to take information from an HTML form and write the info to a text file. It is going to be *very* basic as I only need to write one line to the text file.
It is just so the client can type in the monthly loan rate, or something like that, and save that info to a text file. Then, show the text file on all the pages.
how can a make a select to a database and then stored the results into an excel datasshet using vbscript. I already know how to connect to the database and make the query.
if it's possible to save a file down to someone's C drive from an ASP page. I've left him fiddling around with the FileSystem object and TexStream object, but I don't fancy his chances.
I'm guessing this may not be possible, as people may not be overly happy with the concept of web pages writing files to their machines, but I thought I'd ask. And it's on an intranet if that helps.
I have written to text files in the past, but always appending new data to the end of the text file. I now want to add the new data to the beginning of the file. The text file would be a record of orders placed through a web form. The text file would merely be a record of the orders but it needs to be in descending date order - each new record added to the beginning.
I have one EXE file that customer need to download from my website. But I have one text file of Max 250 bytes of text in in that I want to append to the END of the Binary EXE file and give that for download to user. How can I do that. Please suggest. I think we need to go for some BinaryWrite kind of procedure using ADO Stream.
response.write("<a href=""editprofile.asp"" class=""default"">Edit Profile</a> / <a href=""viewprofile.asp"" class=""default"">View Profile</a> / <a href=""mymessages.asp"" class=""default"">My Messages</a>") how do i put: <!--#include file="noofmessages.asp" --> at the end of my code in the last link My Messages?
I am working on a safetywear deduction system and i need to perform the following functions: write to a text file and read from a test file and wrute to a table in the database. I need code to write and read to a text file in asp please.
I have an ASP application on IIS server: http://localhost/myApp I use ASP and a my own VB activex DLL to create a pdf file and write this file to a subfolder of the Application folder: http://localhost/myApp/pdfs
1- Over IIS I have set the "write permission" for this subfolder. But each time I receive the message: "Can't open output file (bad filename, in use by other application)", error 0x80040202
2- a visual basic test application can call this DLL, generate and write the file without problem to the folder
3- with ASP I generate the file in a normal folder (ie c: emp), it works Then my ASP page use FileSystemObject to copy this file to the folder ...MyApp/pdfs
When I call this page there is no error message, but the programm runs utils the line, where FileSystemObject to copy the file to the folder, then it stops there. The process is hung (dead). The file is not copied...
how can i read the datas in specific columns and rows from excel(.csv) file and then use that datas to calculate the min(example) and write the results into the same excel(.csv) file.
I want to make a log file in which only a date and time are written, when a certain page is visited.
Most scripts and tutorials explain only about how to read a file, and how to write a file.. not on how to write a line at the end of a file(or beginning). I tried the following, but this does not work: Code:
Greetings- <br><br>I have a site that is kind of a portal site- many sites within a single site. Users of the site must use a single logon page that redirects the user to a predetermined "subsite".
Each "subsite" has a few different session variables that are used in varying ways to display information germaine to that user. <br><br>My customer (the portal owner) wants users to be able to render any page on the site to a .PDF that is then sent via email to the user.
I can render an HTML file to PDF via a .COM object, but the problem is that I cannot figure out how to render the .ASP page to HTML. My initial thought was to use MSXMLHTTP to GET the page, but when I do this, the GET method always returns the logon page.
<br><br>What I'd like to do is have a link to a processor page that just "captures" the HTML as it's sent to the browser and writes it to a static HTML file, which I can then easily turn into a PDF. Anyone have any ideas?
Field type is varchar and some data is unicode like this "•õ" It is a chinese. How do I transfer the data I retrive from DB and then I can write it into an text file with its proper chinese word using FileSystemObject. Or any other way ?
I have an asp page that writes to a text file. Can someone tell me what the correct permissions should be on the network - so it's safe from various users coming in to manipulate any files?
I have a folder on webserverwwwroot, called staticContent. The folder has several message of the day text files, such as RepMotd.text. I have an admin page, AdminMotd.aspx, that allows a user to view and edit the contents of the files.
Webserver is running Win Server 2003 64-bit and IIS 6.0. The development machine is Win XP, using Visual Studio 2005 (thus ASP.Net 2.0.)
In IIS, staticContent folder has Write checked and execute permission is set to Script Only . In NTSF, the folder grants full permissions to Network System.
When I try to overwrite an existing file in staticContent, or try to create a new file, I get a System.UnauthorizedAccessException. The Application error log on webserver notes that the error is on the page I am trying to run, that my user name is what I logged in as, that I am authenticated, and that the thread account name is NT AUTHORITYNETWORK SYSTEM. Elsewhere, I am able to read these same files and insert them dynamically into the web page.
This is the code that I am trying to run in AdminMotd.aspx, cut down to the basics. If it makes any difference, the code is run "in page" and not as part of a separate code-behind file.
****************** <script runat="server"> Protected Sub MotdChange(ByVal ThisFile As String, ByVal ThisText As String) Dim sw As StreamWriter = New StreamWriter(StaticRoot + ThisFile, False) sw.Write(ThisText) sw.Close() End Sub
Protected Sub RepMotdChange_Click(Byval sender As Object, ByVal e As System.EventArgs) MotdChange("RepMotd.text", RepMotdText.Text) End Sub </script>
I have traced that the error occurs when New StreamWriter is called, rather than when actually trying to write to the file. Obviously I'm missing something, but danged if I can find it.
I have a form mail script that sends an email and then writes to a text file using Server.CreateObject("Scripting.FileSystemObject").
The problem I am having is that the information needs to be saved in a Password Protected Directory. When I try to save the info it gives me a permission denied error.
I had my hosting company change the permission on the directory and the script was working ok but now it isn't.
Is there a way to pass the username and password in the script so I don't have to worry about the hosting company messing this up?