p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 (http://p2p.wrox.com/forumdisplay.php?f=252)
-   -   Chapter 6 FCKeditor image upload (http://p2p.wrox.com/showthread.php?t=64184)

hdpark November 29th, 2007 06:05 PM

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.






Imar November 29th, 2007 06:27 PM

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.

hdpark November 29th, 2007 07:21 PM

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


Imar November 29th, 2007 07:28 PM

Abd did you change ConfigIsEnabled = False to True in your previous message?

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

Imar November 29th, 2007 07:32 PM

You may also want to take a look here: http://www.cubecart.com/site/forums/...65#entry128265

It's quite old, and targeted at PHP but the same principles apply....

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.

hdpark December 3rd, 2007 03:49 PM

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,



Imar December 3rd, 2007 04:00 PM

You can use the standard File Uploader of the editor for that....

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

hdpark January 28th, 2008 03:46 PM

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


Imar January 28th, 2008 06:36 PM

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.

hdpark February 14th, 2008 08:05 PM

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,






All times are GMT -4. The time now is 10:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.