Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react';
import DropdownMenu from '../DropdownMenu';
import { Menu, MenuItem } from '../Menu';
import { Button } from '../Button';
import isMobile from '../../util/mobile';
import { isMobile } from '../../util/browser';
import {
PERMISSION_CAN_DOWNLOAD,
PERMISSION_CAN_RENAME,
Expand Down
7 changes: 6 additions & 1 deletion src/components/ContentUploader/ContentUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import API from '../../api';
import DroppableContent from './DroppableContent';
import Footer from './Footer';
import makeResponsive from '../makeResponsive';
import { isIE } from '../../util/browser';
import {
CLIENT_NAME_CONTENT_UPLOADER,
DEFAULT_HOSTNAME_UPLOAD,
Expand Down Expand Up @@ -246,7 +247,11 @@ class ContentUploader extends Component<DefaultProps, Props, State> {
uploadFile(item: UploadItem) {
const { rootFolderId, chunked } = this.props;
const { api, file } = item;
api.getUploadAPI(chunked, file.size).upload({

// Disable chunked upload in IE11 for now until hashing is done in a worker
const useChunked = chunked && !isIE();

api.getUploadAPI(useChunked, file.size).upload({
id: rootFolderId,
file,
successCallback: (entries) => this.handleUploadSuccess(item, entries),
Expand Down
24 changes: 24 additions & 0 deletions src/util/browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @flow
* @file Helper to get mobile
* @author Box
*/

/**
* Returns whether browser is mobile.
*
* @return {boolean} Whether browser is mobile
*/
export function isMobile(): boolean {
// Relying on the user agent to avoid desktop browsers on machines with touch screens.
return /iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(navigator.userAgent);
}

/**
* Returns whether browser is IE.
*
* @return {boolena} Whether browser is IE
*/
export function isIE() {
return /Trident/i.test(navigator.userAgent);
}
10 changes: 0 additions & 10 deletions src/util/mobile.js

This file was deleted.