-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement direct file upload #845
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Could not test fully, because of an unrelated error.
One nitpick: when I upload a beautiful (i.e. formatted cells) ods file for import with four rows, it also tries to import the empty rows, resulting in 16384 row creation errors. Might an issue of the IOFactory lib though, and unrelated to this PR.
$phpFileUploadErrors = [ | ||
UPLOAD_ERR_OK => $this->l10n->t('The file was uploaded'), | ||
UPLOAD_ERR_INI_SIZE => $this->l10n->t('The uploaded file exceeds the upload_max_filesize directive in php.ini'), | ||
UPLOAD_ERR_FORM_SIZE => $this->l10n->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'), | ||
UPLOAD_ERR_PARTIAL => $this->l10n->t('The file was only partially uploaded'), | ||
UPLOAD_ERR_NO_FILE => $this->l10n->t('No file was uploaded'), | ||
UPLOAD_ERR_NO_TMP_DIR => $this->l10n->t('Missing a temporary folder'), | ||
UPLOAD_ERR_CANT_WRITE => $this->l10n->t('Could not write file to disk'), | ||
UPLOAD_ERR_EXTENSION => $this->l10n->t('A PHP extension stopped the file upload'), | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used on so many places… should get into some public API imo. But out of scope here.
'application/xml', | ||
'text/html', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to doublecheck that XML and HTML are indeed supported for imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using phpspreasheet to parse import file. It does support xml and html file formats. (https://phpspreadsheet.readthedocs.io/en/latest/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nextcloud/designers Maybe you can check this one and suggest how we should layout the different upload buttons? |
This is a super cool feature! :) General flow looks good! Some comments:
So the end result will look something like this
What do you think? :) |
ea126c7
to
a6389b3
Compare
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
a6389b3
to
207c0a8
Compare
demo.3.webm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice 👍
@blizzz Regarding your row errors mentioned in #845 (review) any chance you have a copy of the file you tried? I could not reproduce that in any way |
demo.2.webm