|
DSN-less Connection to Access / Uploading documents
|
Email
|
| Submitted on: |
9/15/2006 7:47:07 AM |
| By: |
FusionerMX
|
| Level: |
Intermediate |
| User Rating: |
Unrated |
| Compatibility: |
Cold Fusion 5 |
| Views: |
37322 |
|
(About the author) |
|
|
|
The following code shows how to upload a file to a web directory and write that directory to an Access database.
|
| |
Terms of Agreement:
By using this article, you agree to the following terms...
- You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
- You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
- You may link to this article from another website, but ONLY if it is not wrapped in a frame.
- You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
|
The following code shows how to upload a file
to a web directory and write that directory to an Access database.
Keep in mind that this is for users that are
on a PRE-MX (ColdFusion 5.0) environment. CFMX does not currently allow for
DNS-Less connections, due to a "restriction" with JDBC.
If the file exists, then upload it to the
server and process the request.
<cfif FORM.uploadedFile NEQ
''>
<CFFILE ACTION="upload"
FILEFIELD="uploadedFile"
DESTINATION="d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\upload\"
NAMECONFLICT="MAKEUNIQUE">
<cfset upload_file = file.serverfile>
<cfoutput>
#serverFile# successfully added.
Size of the uploaded file: #Numberformat(Evaluate(File.FileSize/1024))#
KB.
</cfoutput>
<br>
<cfset DBPath="d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\Uploads.mdb">
<cfquery name="test"
datasource="#DBPath#"
dbtype="OLEDB"
provider="Microsoft.Jet.OLEDB.4.0"
providerdsn="#DBPath#"
username="Admin"
password="">
INSERT INTO document (documentName)
VALUES ('d:\Inetpub\wwwroot\ccm\intranet\ccm\documents\upload\#upload_file#')
</cfquery>
</cfif>
|
|
Other 19 submission(s) by this author
|
|
Report Bad Submission
|
Your Vote
|
| |
Other User Comments
|
9/28/2006 2:10:39 AM: Irshad
i want to retrieve the Microsoft Access database from the server, i have the server ip address. in asp.net we retrieve the Microsoft Access database from the server though server.mappath but in vb.net how to do it, i don't know plz help me, that's very urgent (If this comment was disrespectful, please report it.)
|
10/17/2007 7:31:19 PM: abdlrahman
Good job !!! Thanks. (If this comment was disrespectful, please report it.)
|
Add Your Feedback
Your feedback will be posted below and an email sent to
the author. Please remember that the author was kind enough to
share this with you, so any criticisms must be stated politely, or they
will be deleted. (For feedback not related to this particular article, please
click here instead.)
To post feedback, first please login.
|