Solved

CFFILE upload and read!

Posted on 2007-03-20
7
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

728 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