NetTalk Central

Author Topic: Redactor uploads to Web\Uploads  (Read 2112 times)

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Redactor uploads to Web\Uploads
« on: September 13, 2014, 05:42:03 AM »
Hi Bruce, using redactor on a form, works nicely thanks, but

I am letting a teachers make simple lessons, I need to allow for duplicate resources being uploaded  Eg. you have cat.jpg and so do I

SO I want to make the lesson Id part of the directory structure
Eg. Web\Lesson\1\cat.jpg      for lesson 1
Eg. Web\Lesson\2\cat.jpg      for lesson 2

I can use string theory in validateRecord to fix the record being saved
then move the jpg from the upload directory to the Lesson\1 directory

But I would rather set the form as it is created to have its default directory as Lesson\1 instead of upload - save having to move all the jpgs they upload.

I see its set in the siteQueue  as the Defaults.UploadsPath
So in the handler - p_web.RenameFile
I put      self.Site.UploadsPath = 'D:\APPS\SmallAPP\web\lesson\2'  
  
This worked, the form took the name and the file was saved where I wanted it
But it locked something up, I could not drag a second image onto a form, even for a different record

Am I close?
Thanks
« Last Edit: September 13, 2014, 07:18:33 AM by MyBrainIsFull »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Redactor uploads to Web\Uploads
« Reply #1 on: September 18, 2014, 06:41:36 AM »
I'm verifying it Kevin - but in the meantime make sure that immediate validation (on the validation tab) for the specific Redactor field is set as NO.
Let me know if that solves the problem for you.

cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Redactor uploads to Web\Uploads
« Reply #2 on: September 18, 2014, 10:02:07 AM »
I have the same problem including image of any others to redactor. sametime works sometime not.

Regards,
Walter
Walter - SOFTVALE

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Redactor uploads to Web\Uploads
« Reply #3 on: September 18, 2014, 04:40:40 PM »
Cheers Bruce
Yes immediate validation is turned off, and redactor is allowing the functions like <H1> etc that it does not when immediate is turned off.  So thats good.

PLEASE NOTE
I dont think it is redactor at fault,  the issue is our inability to override the upload folder when the form is created, as it must be taking the path from the site Q,
I think intercepting this at the handler is my issue, it should be achieved at the form

I will send you my app and dct with data to assist your investigation by email, with an explanatory note.

Thanks for your help in this
K