|
|
cold fusion web hosting
|
|
|
|
coldfusion webhosting - Editor B L
RajaSrinivas The developed CF Application has to be uploaded on Web. The CFFTP tag is used to perform server-to-server operations. The cffile, cfcontent and cfdirectory tags manage the server file and browser. Cffile Tag This tag works with files on your server as Files uploaded from a client to the Web server using an HTML form. Files on the server can be moved, renamed, copied or deleted. The Text files on the server is read or written or appended. The action attribute cffile tag manages to upload, rename, and copy, delete, read, and readBinary, move, write and append. For security purpose the cffile tag can be disable by using the Restrictions page of the ColdFusion Administrator Security tab. Uploading Files The major task is to upload our developed application.
Here the HTML file is create to upload a CF application “ uploadTaxInfo.cfm”
<html> <head> <title> File to Upload </title> </head> <body> <h3> File to Upload </h3> <form action=”uploadTaxInfo.cfm” enctype = “multipart/form-data” method = “post”> <p> Enter the Path and Filename to upload: <input type = “file” name = “FiletoUpload” size=”45”> </p> <input type=”submit” value”Upload”> </form> </body> </html>
<form> tag creates a form that contains selected file to be uploaded. The enctype attribute confirms the server that the form submitted an uploaded file. <input> tag performs the “file” type, which instructs the browser to read and transmit a file from the user’s system to the server. Next the action program is created to upload the action page Open the ColdFusion Studio and create a new file <html> <head> <title> upload file </title> </head> <body> <h3> Upload file </h3> <cffile action = “upload” destination =”c:\temp” nameConflict=”overwrite” fileField=”Form.FiletoUpload”> <cfoutput> Upload the file #cffile.ClientFileName#.#cffile.ClientFileExt# to #cffile.ServerDirectory#\#cffile.ServerFileName#.#cffile.ServerFileExt#. </cfoutput> </body> </html>
<cffile action=”upload” it prepares to upload a file to the server. Destination=”c:\temp” it specifies the destination of the file. NameConflict=”overwrite” specify to overwrite if the file already exist FileField=”Form.FiletoUpload”> specify the name of the file to be uploaded. #cffile…#cffile.ServerFileExt# specifies the user of the file that was uploaded and its destination. Uploaded File results:
Once the file upload is completed, can receive the status information using file upload variables. This status information includes range of data about the file ie the path of the file and its name.
Cffile is suitable for file upload status variable. For example cffile.ClientDirectory. This status variable can be used anywhere that you use ColdFusion variables.
List shown below is the file status variables that are available after an upload.
ClientDirectory ClientFile ClientFileName ClientFileExt Attempted ServerFile ContentSubType ContentType DateLastAccessed FileExisted FileSize FileWasAppended FileWasRenamed FileWasOverwritten FileWasSaved ServerDirectory OldFileSize ServerFileName ServerFile ServerFileExt TimeCreated TimeLastModified
Cold fusion index |
|
|
cold fusion ~
Editor B L RajaSrinivas |
Copyright 2004.Indianchild.com.All rights reserved. No Content from our pages can be used /copied /downloaded for any use/publication/website in whatsoever manner without our written permission. We take action on infringement. Category editors disclaim responsibility for suggestions and recommendations. We are not representing or affiliated with products or sites reviewed.