Jump to:

5521 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » First upload images to Temp, then to Final folder

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 183 Views
  • Johnny9
    Avatar
    Community Member
    19 Posts

    First upload images to Temp, then to Final folder Link to this post

    Hi, I want to do something like this..

    I have front end form with text fields and upload fields.. User can enter text and upload images and after pressing submit button, page is created.

    One problem which I have is, uploadfield uploads images automaticaly, and if user didn't press submit and leave page, page is not created, but images sits in assets folder.

    How could I make that images first goes to temp folder, and after user presses Submit button, images goes to Final folder and page is created?

    Thanks for any help

  • svandragt
    Avatar
    Community Member
    44 Posts

    Re: First upload images to Temp, then to Final folder Link to this post

    To change the folder name the upload field uploads files into:

          $YourUploadField= $form->Fields()->dataFieldByName('YourUploadField');
          $folder = '';
          $YourUploadField->setFolderName($folder);

    Not sure about the rest.

    183 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.