ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old May 31st, 2004, 10:13 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
Angry destination folder

I have a form which I can browse for a file and upload it to another folder on my local machine.e.g c:/ etc.

The coldfusion bible only gives examples of local machine for destination but I need to upload to a server. I have tried the http address but the file doesn't upload. I have also tried a path name e.g ./images/house.jpg but this doesn't work either.

Can you help.

Cheers

Peter

Reply With Quote
  #2  
Old May 31st, 2004, 07:44 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
If you want to let the user upload a file from their local system to the ColdFusion server, use CFFILE:

http://livedocs.macromedia.com/cold...5.htm#wp3540091
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old June 3rd, 2004, 09:15 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
destination

I have it all working using cffile but only to a local directory. Should it work on hosting server using relative path e.g ./images/full.jpg or do you need http://www.hostname/images.full jpg for example.

neither seem to work. If i use http as above do I need to supply username and password in the url?

Cheers
peter

Reply With Quote
  #4  
Old June 3rd, 2004, 12:46 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
The destination attribute of CFFILE is an absolute path on the SERVER. This is from the documentation link I sent earlier:

destination: Pathname of directory in which to upload the file. If not an absolute path (starting a with a drive letter and a colon, or a forward or backward slash), it is relative to the ColdFusion temporary directory, which is returned by the GetTempDirectory function.

So you could use a destination like "C:\cfusionmx\wwwroot\mysite\myuploadfolder\", which would put the file into that directory on the server.

If you still can't get this to work, try posting your code so we can see what you're doing incorrectly.

Reply With Quote
  #5  
Old June 17th, 2004, 09:05 AM
elise_driver elise_driver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Norwich
Posts: 53 elise_driver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m 10 sec
Reputation Power: 5
still having probs

I am still having problems getting an image to upload when I ftp the file to the server. I have supplied the code below.

It works fine using wwwroot on my local machine but not on the server. Hope you can help.

Cheers

peter


<style type="text/css">
<!--
.style1 {
color: #000066;
font-weight: bold;
}
.style2 {color: #990000}
-->
</style>

<cftry>

<cffile action = "upload" fileField = "FileContents" destination = "C:\Inetpub\wwwroot\Bernada_golf\images\resale_thumb" accept = "image/pjpeg, image/gif, image/bmp, image/jpg," nameConflict="overwrite">
<div align="center" class="style1">
<p><img src="images/upload%20success.jpg" width="287" height="43"></p>
<p>Your Thumbnail image has been successfully uploaded to the server.
<br>
<br>
Please make sure you have added the image file name into the insert form.
<br>
<br>
<span class="style2">Please use the back button to upload more images as required.</span> </p>
</div>
<table width="669" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="449"><div align="center">
<input name="button" type=button onClick="javascript:self.close();" onKeyPress="javascript:self.close();" value="Close Window">
</div></td>
</tr>

</tr>
</table>
<cfcatch type = "any">
<div align="center" class="style1">
<p><img src="images/upload%20error.jpg" width="287" height="43"></p>
<p>File upload didn't work or the server could not accept your file type.
<br>
<br>
Please make sure you have browsed for a file to upload
<br>
<br>
Only files of type .jpeg, .jpg, .gif and .bmp files will be accepted.
<br>
<br>
<span class="style2">Please use the back button to retry.</span> </p>
</div>
<table width="457" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="449"><div align="center">
<input name="button" type=button onClick="javascript:self.close();" onKeyPress="javascript:self.close();" value="Close Window">
</div></td>
</tr>

</tr>
</table>
</cfcatch>


</cftry>

Reply With Quote
  #6  
Old June 18th, 2004, 08:13 AM
bfolger71 bfolger71 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Boston, MA
Posts: 47 bfolger71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 34 sec
Reputation Power: 5
If it's working fine on your local machine, but not to the server, it seems permissions related. Double check, and be sure that you have rights to write to, the absolute path you're specifying on the server.

Reply With Quote
  #7  
Old July 16th, 2004, 02:11 PM
AsianOne974 AsianOne974 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 AsianOne974 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 26 sec
Reputation Power: 0
I have a question concerning permission on the destination folder. I was able to get <cffile> to work as long as there was no restriction on the folder.

My problem is that my client does not want to have this folder available to all users due to security issues. They want to create an owner account for the destination folder and only this system account will have write access to the folder. Is there any way I can get cffile to work in this situation? Other alternatives will also be helpful.

Thanks in advance,

AOne.

Reply With Quote
  #8  
Old July 18th, 2004, 02:01 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Consider the creation of an OS/Domain user specifically for ColdFusion. Then set the CF services to use this username and password. On Windows you can configure this is the services manager. I'm not sure how it's done on UNIX but I am positive it can be done.

Once you have CF using its own account, you can secure the directory and only allow the CF account to read/write files to that directory.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > destination folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway