Jump to content

Upload file in front-end


matjazp
 Share

Recommended Posts

I have a page with files (attachments). I would like to allow a user to add files as simple as possible. I don't want to give the user full access to admin. So click on the link/button "Add new attachment" would open modal with login form, after successful login a file upload would be presented to the user and he would upload the file. Thanks for any hints.

Link to comment
Share on other sites

horst, thx for the hints. Another question: how to "move" individual file object from one File field to another File field without removing the file itself? Eg. have a page with two fields: files (multiple files are allowed) and onefile (maximum file upload = 1). User is allowed to access just onefile (I'm using fredi), he uploads the file and then this new uploaded file should get appended to other files:

if($page->onefile && count($page->onefile)) {
	$page->setOutputFormatting(false);
	$page->files->append($page->onefile);
	$page->save();
	$page->setOutputFormatting(true);
}

 Now I would like to "empty" onefile field (to be ready for the nex upload) but without deleting the actual file itself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...