Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2007, 06:05 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.





  #2 (permalink)  
Old November 29th, 2007, 06:27 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
  #3 (permalink)  
Old November 29th, 2007, 07:21 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #4 (permalink)  
Old November 29th, 2007, 07:28 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
  #5 (permalink)  
Old November 29th, 2007, 07:32 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
  #6 (permalink)  
Old December 3rd, 2007, 03:49 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,


  #7 (permalink)  
Old December 3rd, 2007, 04:00 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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
  #8 (permalink)  
Old January 28th, 2008, 03:46 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #9 (permalink)  
Old January 28th, 2008, 06:36 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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.
  #10 (permalink)  
Old February 14th, 2008, 08:05 PM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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,




 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload image-create & save thumbnail-display image angshujit ASP.NET 2.0 Professional 6 July 11th, 2013 10:34 PM
Upload image phuc2583 Classic ASP Basics 1 January 17th, 2008 08:48 AM
Chapter 7 - Problem with filepath on Image Upload btaysisson BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 December 18th, 2007 05:54 AM
chapter 7 image upload on Mac OS X laolaonk BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 February 19th, 2006 10:20 PM
Image upload Pallav Javascript How-To 8 October 21st, 2004 12:14 AM



All times are GMT -4. The time now is 09:41 AM.


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