| Name | Type | Default |
|
autoUpload
# |
boolean
|
false
|
Sets or gets whether files will be automatically uploaded when selected.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
accept
# |
string
|
null
|
Sets or gets the file types that can be submitted to the server through jqxFileUpload. This property corresponds to the accept attribute of the hidden file input which is submitted to the URL specified by the uploadUrl property.
Possible values:
any file extension, for example: '.gif', '.jpg', '.png', '.doc', etc.
'audio/*' - all sound files are accepted.
'video/*' - all video files are accepted.
'image/*' - all image files are accepted.
any valid media type. For a list, please refer to <A href="http://www.iana.org/assignments/media-types/media-types.xhtml" target=_blank>IANA Media Types</A>.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
browseTemplate
# |
FileUploadTemplate
|
''
|
FileUploadTemplate: "default" | "primary" | "success" | "warning" | "danger" | "inverse" | "info" | "link"
Sets or gets the template applied to the 'Browse' button.
Possible Values:
'default' - the default button's template. The button's style depends only on the 'theme' property value.
'primary' - dark blue button for extra visual weight.
'success' - green button for successful or positive action.
'warning' - orange button which indicates caution.
'danger' - red button which indicates a dangerous or negative action.
'inverse' - dark gray button, not tied to a semantic action or use.
'info' - blue button, not tied to a semantic action or use.
'link' - making it look like a link.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
cancelTemplate
# |
FileUploadTemplate
|
''
|
FileUploadTemplate: "default" | "primary" | "success" | "warning" | "danger" | "inverse" | "info" | "link"
Sets or gets the template applied to the 'Cancel All' button.
Possible Values:
'default' - the default button's template. The button's style depends only on the 'theme' property value.
'primary' - dark blue button for extra visual weight.
'success' - green button for successful or positive action.
'warning' - orange button which indicates caution.
'danger' - red button which indicates a dangerous or negative action.
'inverse' - dark gray button, not tied to a semantic action or use.
'info' - blue button, not tied to a semantic action or use.
'link' - making it look like a link.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
disabled
# |
boolean
|
false
|
Enables or disables the jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
fileInputName
# |
string
|
''
|
Sets or gets the name attribute of the hidden file input which is submitted to the URL specified by the uploadUrl property. This name is applied to the file input of the file about to be uploaded and after the upload the name attribute is removed so that it can be set to the next hidden file input (if any). As a result, there is only one file input with this name attribute at a time.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
height
# |
number | string
|
'auto'
|
Sets or gets the jqxFileUpload's height.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
localization
# |
FileUploadLocalization
|
null
|
Interface FileUploadLocalization { browseButton?: string; uploadButton?: string; cancelButton?: string; uploadFileTooltip?: string; cancelFileTooltip?: string; }
Sets the various text values used in the widget. Useful for localization.
The localization object has the following fields:
browseButton - sets the text of the 'Browse' button.
uploadButton - sets the text of the 'Upload All' button.
cancelButton - sets the text of the 'Cancel All' button.
uploadFileTooltip - sets the text of the 'Upload File' tooltip.
cancelFileTooltip - sets the text of the 'Cancel' tooltip.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
multipleFilesUpload
# |
boolean
|
true
|
Sets or gets whether multiple files selection and upload are allowed.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
renderFiles
# |
(filename:FileUploadRenderFiles['fileName']) => void
|
null
|
Interface FileUploadRenderFiles { fileName?: string; }
A callback function used for rendering the file selection rows.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
rtl
# |
boolean
|
false
|
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
theme
# |
string
|
''
|
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
uploadUrl
# |
string
|
''
|
Sets or gets the upload URL. This property corresponds to the upload form's action attribute. For example, the uploadUrl property can point to a PHP file, which to handle the upload operation server-side. Here is a sample PHP file that allows only images no larger than 500 kB to be uploaded to the server:
<?php$target_dir = "uploads/";$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);$uploadOk = 1;$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);// Check if image file is a actual image or fake imageif(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; }}// Check if file already existsif (file_exists($target_file)) { echo "Sorry, file already exists."; $uploadOk = 0;}// Check file sizeif ($_FILES["fileToUpload"]["size"] > 500000) { echo "Sorry, your file is too large."; $uploadOk = 0;}// Allow certain file formatsif($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"&& $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0;}// Check if $uploadOk is set to 0 by an errorif ($uploadOk == 0) { echo "Sorry, your file was not uploaded.";// if everything is ok, try to upload file} else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; } else { echo "Sorry, there was an error uploading your file."; }}?>
A few notes about file uploads in PHP:
Many shared hosting servers allow a very low maximum file upload size. If you plan on accepting larger files, you should consider a dedicated or virtual dedicated server. To adjust the file upload size in PHP, modify the php.ini file's "upload_max_filesize" value. You can also adjust this value using PHP's .ini_set() function. The file upload counts towards the hosting environment's $_POST size, so you may need to increase the php.ini file's post_max_size value. Be sure to do a lot of file validation when allowing users to upload files. How horrible would it be to allow a user to upload a .exe file to your server? They could do horrible things on the server.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
uploadTemplate
# |
FileUploadTemplate
|
''
|
FileUploadTemplate: "default" | "primary" | "success" | "warning" | "danger" | "inverse" | "info" | "link"
Sets or gets the template applied to the 'Upload All' button.
Possible Values:
'default' - the default button's template. The button's style depends only on the 'theme' property value.
'primary' - dark blue button for extra visual weight.
'success' - green button for successful or positive action.
'warning' - orange button which indicates caution.
'danger' - red button which indicates a dangerous or negative action.
'inverse' - dark gray button, not tied to a semantic action or use.
'info' - blue button, not tied to a semantic action or use.
'link' - making it look like a link.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
width
# |
string | number
|
null
|
Sets or gets the jqxFileUpload's width.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
|
|
remove
# |
Event
|
|
This event is triggered when a file row has been removed.
Code examples #
Bind to the remove event of jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
select
# |
Event
|
|
This event is triggered when a file has been selected.
Code examples #
Bind to the select event of jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
uploadStart
# |
Event
|
|
This event is triggered when a file upload operation has started.
Code examples #
Bind to the uploadStart event of jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
uploadEnd
# |
Event
|
|
This event is triggered when a file upload operation has ended.
Code examples #
Bind to the uploadEnd event of jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
|
| Name | Arguments | Return Type |
|
browse
# |
None
|
|
|
|
|
cancelFile
# |
fileIndex
|
|
|
|
|
cancelAll
# |
None
|
|
Cancels all selected files.
|
|
destroy
# |
None
|
|
Destroys the jqxFileUpload.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
useEffect(() => {
myFileUpload.current!.destroy();
}, []);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
render
# |
None
|
|
Renders the widget.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
useEffect(() => {
myFileUpload.current!.render();
}, []);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
refresh
# |
None
|
|
Refreshes the widget.
import { createRoot } from 'react-dom/client';
import { useEffect, useRef } from 'react';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import JqxFileUpload from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxfileupload';
function App() {
const myFileUpload = useRef<JqxFileUpload>(null);
useEffect(() => {
myFileUpload.current!.refresh();
}, []);
return (
<div>
<p>
Note: to be able to upload a file you would have to set the property uploadUrl to
point to a file hosted on your server, which handles the upload process.
</p>
<JqxFileUpload ref={myFileUpload} />
</div>
);
}
createRoot(document.querySelector('#app') as HTMLElement).render(<App />);
|
|
uploadFile
# |
fileIndex
|
|
|
|
|
uploadAll
# |
None
|
|
Uploads all selected files.
|