Solved

CFFILE upload and read!

Posted on 2007-03-20
7
261 Views
Last Modified: 2012-06-27
Hi,

I need users to upload a file from the desktop and want them to store it in this folder "c:\CFprojects\Docs\". After that, if there is a document in this folder, I need that to be linked in the page.

Please help me out.

Thanks in advance.
0
Comment
Question by:sharon212
  • 4
  • 3
7 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 18758735


<cfset varTmp = form.doc>


<cffile action="UPLOAD"
        filefield="form.doc"
        destination="c:\CFprojects\Docs\"
        nameconflict="MAKEUNIQUE"
        accept="*.*">

Upload Results
<cfoutput>
<cfif fileexists("c:\CFprojects\Docs\#form.doc#")>
#form.doc#
</cfif>
</cfoutput>

or on a page other than the upload page

<cfdirectory action="list" directory="c:\CFprojects\Docs\" name="myDir">

<cfoutput query = "MyDir">
<a href="http://relativepathto/cfprojects/docs/#myDir.name#">#myDir.name#</a>
</cfouput>





0
 

Author Comment

by:sharon212
ID: 18758862
Hey thanks.

I could upload my files.

But I am not able to link that file in my web page.

0
 

Author Comment

by:sharon212
ID: 18759099
Hi, I could get the links too.. but it is not opening.  When I click the link, it says "the page cannot be found"
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 18759166
can you post your code
0
 

Author Comment

by:sharon212
ID: 18759237

    <tr>
      <td class = "tdhdr-v"> Upload </td>
      <td class = "tdhdr1"> <input type = "file" name = "Nprtfile" size = "20" >
                        <input type="submit" name="fileUpload" value="Go!" />
      </td>
    </tr>

<cffile action = "upload"  
      fileField = "Nprtfile"  
      destination = "c:\CFProjects\DevAG\temp\"
      accept = "image/jpg, application/ms-excel, application/msword, application/pdf">

<cfdirectory action="list" directory="c:\CFprojects\DevAG\Temp\" name="Dirfil">

</cfoutput>

<cfoutput query = "Dirfil">
<tr>
<a href="http://mypath/cfprojects/DevAG/#Dirfil.name#">#Dirfil.name#</a>
</tr>
</cfoutput>

And also I am not able to upload ms-excel files.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 18759919


try adding

<cfoutput query = "Dirfil">
<tr>
<a href="http://mypath/cfprojects/DevAG/#Dirfil.name#.DOC">#Dirfil.name#</a>
</tr>
</cfoutput>

 If that works we'll be needing some extension handling...
0
 

Author Comment

by:sharon212
ID: 18774464
Thank you very much for your help. What I did was, just I made it mypath under the webserver (inet). that's all. It works great.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now