 |
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
 | This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

November 29th, 2007, 06:05 PM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 6 FCKeditor image upload
Hi Imar,
I am trying to upload images files. I did like this:
1. <appSettings>
<add key="FCKeditor:UserFilesPath" value="/UserFiles"/>
</appSettings>
2. FCKeditor screen>Insert/Edit Image>Click Upload Tab>Browse Image>Send it to the Server
3. Then I have this error message: "This file uploader is disabled. Please check the "editor/filemanager/upload/asp/config.asp" file
4. So I copied those codes from "editor/filemanager/upload/asp/config.asp".
' SECURITY: You must explicitelly enable this "uploader" (set it to "True").
Dim ConfigIsEnabled
ConfigIsEnabled = False
' Path to user files relative to the document root.
Dim ConfigUserFilesPath
ConfigUserFilesPath = "/UserFiles/"
Then what shall I do?
Your kind advices would be really appreciated.
|
|

November 29th, 2007, 06:27 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
There's a . js file (fckconfig. js) in the main editor folder where you can configure this.
If that doesn't help, check out the FCK Editor site and their support forums.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

November 29th, 2007, 07:21 PM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
I found some codes in fckconfig. js file like follows.
What do I change here?
Thanks,
FCKConfig.ImageUpload = true ;
FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/asp/upload.asp?Type=Image' ;
// PHP // FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/php/upload.php?Type=Image' ;
FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png)$" ; // empty for all
FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
|
|

December 3rd, 2007, 03:49 PM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
1. It was my operation mistake.
If I use "Image Info" instead "Upload", it's working fine.
Thanks for your kind help.
2. My next question is how to upload Audio files at FCKeditor?
Thanks,
|
|

January 28th, 2008, 03:46 PM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
I made file upload codes as follows.
1. When I run it at local PC with "FileUpload1.SaveAs("\UserFiles\" & FileUpload1.FileName)", it is working fine.
2. When I run it at hosting site(discountasp.net), it gives error "is not rooted". Would you please advise me what codes I should use?
Thanks,
HD
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
If FileUpload1.HasFile Then
Try
FileUpload1.SaveAs("\UserFiles\" & FileUpload1.FileName)
lblUpload.Text = "File name: " & _
FileUpload1.PostedFile.FileName & "<br>" & _
"File Size: " & _
FileUpload1.PostedFile.ContentLength & " kb<br>" & _
"Content type: " & _
FileUpload1.PostedFile.ContentType
Catch ex As Exception
lblUpload.Text = "ERROR: " & ex.Message.ToString()
End Try
Else
lblUpload.Text = "You have not specified a file."
End If
End Sub
|
|

January 28th, 2008, 06:36 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi hdpark,
You may need to map UserFiles to a physical path first using Server.MapPath. E.g.:
FileUpload1.SaveAs(Server.MapPath("/UserFiles/") & FileUpload1.FileName)
If that doesn't help, can you post the exact error message? I doubt it's just "is not rooted"...
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
|
|

February 14th, 2008, 08:05 PM
|
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
I have got the physical path from hosting company, then it is working fine with codes "FileUpload1.SaveAs("e:\web\myaccount\htdocs\UserF iles\" & FileUpload1.FileName".
But your instruction looks like more generic. When I use your instruction "FileUpload1.SaveAs(Server.MapPath("/UserFiles/") & FileUpload1.FileName)", I have error message "Failed to map the path '/UserFiles/'".
Is there anyway I can use your instruction style?
Thanks Imar for your kind help,
|
|
 |