sharon212
asked on
CFFILE upload and read!
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.
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.
ASKER
Hey thanks.
I could upload my files.
But I am not able to link that file in my web page.
I could upload my files.
But I am not able to link that file in my web page.
ASKER
Hi, I could get the links too.. but it is not opening. When I click the link, it says "the page cannot be found"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<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\D
</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.
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...
ASKER
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.
<cfset varTmp = form.doc>
<cffile action="UPLOAD"
filefield="form.doc"
destination="c:\CFprojects
nameconflict="MAKEUNIQUE"
accept="*.*">
Upload Results
<cfoutput>
<cfif fileexists("c:\CFprojects\
#form.doc#
</cfif>
</cfoutput>
or on a page other than the upload page
<cfdirectory action="list" directory="c:\CFprojects\D
<cfoutput query = "MyDir">
<a href="http://relativepathto/cfprojects/docs/#myDir.name#">#myDir.name#</a>
</cfouput>