This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
upgrading-to-5.html
322 lines (241 loc) · 20.7 KB
/
upgrading-to-5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<title>Upgrading to 5.x | Fine Uploader Documentation</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="icon" href="/favicon.ico">
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Maven+Pro:700,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/branch/master/_static/css/main.css" />
<link rel="stylesheet" href="/branch/master/_static/css/pygments.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse" aria-label="mobile navigation menu">
<span class="hide">mobile navigation menu</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a class="brand" href="http://fineuploader.com/"><img style="margin-top: -10px; height: 20px" src="https://fineuploader.com/img/FineUploader_logo.png" alt="Fine Uploader logo"></a></li>
<li><a href="/branch/master">Docs</a></li>
<li><a href="https://blog.fineuploader.com/">Blog</a></li>
<li class="dropdown">
<button id="features-menu-trigger" class="dropdown-toggle btn btn-link" data-toggle="dropdown">Features <b class="caret"></b></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="features-menu-trigger">
<li role="presentation"><a role="menuitem" href="/branch/master/features/async-tasks-and-promises.html">Async Tasks & Promises</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/azure.html">Azure Blob Storage Uploads</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/cancellable-uploads.html">Cancelling</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/chunking.html">Chunking</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/concurrent-chunking.html">Concurrent Chunking</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/CORS.html">CORS</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/delete.html">Delete</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/drag-and-drop.html">Drag and Drop</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/handling-errors.html">Error Handling</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/modules.html">ES6 & CommonJS Support</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/filename-edit.html">Filename Editing</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/forms.html">Form Support</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/session.html">Initial File Lists</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/extra-buttons.html">Multiple Upload Buttons</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/no-server-uploads.html">No-Server Uploads</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/paste-to-upload.html">Paste</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/pause.html">Pause In-Progress Uploads</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/progress-bars.html">Progress Bars</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/thumbnails.html">Previews & Thumbnails</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/request-parameters.html">Request Parameters</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/resume.html">Resuming</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/retry.html">Retrying</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/s3.html">S3 Uploads</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/statistics-and-status-updates.html">Stats & Status</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/styling.html">Styling</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/upload-files.html">Uploading</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/scaling.html">Upload Scaled Images</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/upload-from-mobile-camera.html">Upload via Mobile Camera</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/validation.html">Validation</a></li>
</ul>
</li>
<li class="dropdown">
<button id="api-menu-trigger" class="dropdown-toggle btn btn-link" data-toggle="dropdown">API <b class="caret"></b></button>
<ul class="dropdown-menu api" role="menu" aria-labelledby="api-menu-trigger">
<li><b>Options</b></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/options.html">Core</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/options-ui.html">UI</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/options-s3.html">S3</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/options-azure.html">Azure</a></li>
<li class="divider"></li>
<li><b>Methods</b></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/methods.html">Core & UI</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/methods-s3.html">S3</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/methods-azure.html">Azure</a></li>
<li class="divider"></li>
<li><b>Events</b></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/events.html">Core & UI</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/api/events-s3.html">S3</a></li>
<li class="divider"></li>
<li role="presentation"><a role="menuitem" style="margin-left: -20px;" href="/branch/master/api/qq.html">Utilities</a></li>
</ul>
</li>
<li class="dropdown">
<button id="servers-dropdown-trigger" class="dropdown-toggle btn btn-link" data-toggle="dropdown">Servers <b class="caret"></b></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="servers-dropdown-trigger">
<li role="presentation"><a role="menuitem" href="/branch/master/endpoint_handlers/traditional.html">Traditional</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/endpoint_handlers/amazon-s3.html">Amazon S3</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/endpoint_handlers/azure.html">Azure Blob Storage</a></li>
</ul>
</li>
<li class="dropdown">
<button id="support-dropdown-trigger" class="dropdown-toggle btn btn-link" data-toggle="dropdown">Support <b class="caret"></b></button>
<ul class="dropdown-menu support" role="menu" aria-labelledby="support-dropdown-trigger">
<li role="presentation"><a role="menuitem" href="/branch/master/browser-support.html">Browsers</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/faq.html">FAQ</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master/features/handling-errors.html">Handling Errors</a></li>
</ul>
</li>
<li class="dropdown">
<button id="version-dropdown-trigger" class="dropdown-toggle btn btn-link" data-toggle="dropdown">Version <b class="caret"></b></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="version-dropdown-trigger">
<li role="presentation"><a role="menuitem" href="/branch/master">Current: 5.16.2</a></li>
<li role="presentation"><a role="menuitem" href="/branch/master">Stable</a></li>
<li role="presentation"><a role="menuitem" href="/branch/develop">In Progress</a></li>
<li role="presentation">
<form class="tag-chooser">
<input class="tag-input" name="tag" placeholder="5.4.0">
<button class="btn btn-info">Go</button>
</form>
</li>
</ul>
</li>
</ul>
<form method="get" id="search" action="https://duckduckgo.com/" class="navbar-form pull-right">
<input type="hidden" name="sites" value="docs.fineuploader.com/branch/master"/>
<!-- Header -->
<input type="hidden" name="kj" value="#0088CC"/>
<!-- Background -->
<input type="hidden" name="k7" value="#FFFFFF"/>
<!-- Text -->
<input type="hidden" name="k8" value="#444444"/>
<!-- Links -->
<input type="hidden" name="k9" value="#0088CC"/>
<!-- Visited Links -->
<input type="hidden" name="kaa" value="#0088CC"/>
<!-- URLS -->
<input type="hidden" name="kx" value="#F87436"/>
<!-- Font -->
<input type="hidden" name="kt" value="h"/>
<input type="text" name="q" maxlength="255" placeholder="Search…" class="span2" title="search documentation" style="margin-top: 4px;"/>
<input type="submit" value="DuckDuckGo Search" style="visibility: hidden; width: 0;" />
</form>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class='row-fluid'>
<div class="span2 sidebar">
</div>
<div class="span9 content">
<span class="pull-right version-number"><p>5.16.2</p></span>
<h1 class="page-header" id="upgrading-to-5x">Upgrading to 5.x</h1>
<p>The 5.0 version brings some breaking changes, mostly surrounding upload requests.</p>
<p>If you are upgrading from a 3.x version, be sure to also read the <a href="upgrading-to-4.html">Upgrading to 4.x document</a>.</p>
<h3 id="resume-data-persisted-using-localstorage-for-traditional-endpoints">Resume data persisted using localStorage for traditional endpoints</h3>
<p>Fine Uploader no longer uses cookies to persist auto-resume data for traditional endpoints. Now, all auto-resume
data is persisted to <code>localStorage</code> for all endpoint handlers.</p>
<p>This means that any existing auto-resume records will be lost when you switch to a 5.x version if you utilize
a traditional endpoint handler.</p>
<h3 id="persisted-resume-data-format-changed-for-s3-and-azure-upload-endpoints">Persisted resume data format changed for S3 and Azure upload endpoints</h3>
<p>This means that any existing resume records will be ignored. This format change was required to
support the new concurrent chunking feature.</p>
<h3 id="most-xhr-requests-will-now-contain-an-accept-header">Most XHR requests will now contain an Accept header</h3>
<p>This is probably not technically a breaking change, but it should be mentioned here just in case your
server, for some reason, is not expecting this header on requests from Fine Uploader. This change
affects all <code>XMLHttpRequest</code> originated requests sent to local servers
(i.e. not requests sent to S3/Azure).</p>
<p>Your can look at this header to programmatically determine the correct Content-Type for your response,
but you should <strong>NOT</strong> rely on this value for upload requests in IE9 and older since the Accept header
is set by the browser and is not reflective of the expected response Content-Type. Also, ajax requests
sent in IE9 and IE8 in a cross-origin environment will not contain this header, since
the <code>XDomainRequest</code> transport is used and does not allow headers to be specified.</p>
<h3 id="removed-all-utility-functions-that-deal-with-cookies">Removed all utility functions that deal with cookies</h3>
<p>As a result of the switch from cookies to <code>localStorage</code>, we removed these cookie-related utility
functions as they are no longer needed by Fine Uploader. If you were utilizing these utility functions for your app,
consider importing a cookie library as a replacement, such as <a href="https://github.com/carhartl/jquery-cookie">jquery-cookie</a> or <a href="https://github.com/ScottHamper/Cookies">Cookies</a>.</p>
<p>The specific removed util functions were:</p>
<ul>
<li><code>qq.areCookiesEnabled</code></li>
<li><code>qq.getCookie</code></li>
<li><code>qq.setCookie</code></li>
<li><code>qq.deleteCookie</code></li>
</ul>
<h3 id="changes-to-resume-option">Changes to <code>resume</code> option</h3>
<p>The <code>id</code> property of the <code>resume</code> option was removed. Very few integrators, if any, were making use of this option.
If you were making use of this option property, any existing resume records will be lost when you upgrade to 5.x.</p>
<p>Also, for traditional endpoints, the <code>cookiesExpireIn</code> option has changed to <code>recordsExpireIn</code>. This is related to
the switch from cookies to <code>localStorage</code>.</p>
<h3 id="onresume-callback-is-no-longer-promissory">onResume callback is no longer promissory</h3>
<p>A promise is no longer an acceptable return type from an <code>onResume</code> callback. It was unclear what benefit this
provided, and supporting this made the code more complicated. Due to a long-standing oversight in the code,
promises were only accepted from <code>onResume</code> callbacks when using the traditional endpoint handler anyway.</p>
<h3 id="chunked-request-only-sent-for-traditional-endpoints-if-necessary">Chunked request only sent for traditional endpoints if necessary</h3>
<p>If the chunking.partSize value is greater than or equal to the size of the
file, no chunking will occur. Note that a chunked request is different from
a non-chunked request due to differing headers, and the fact that the
message-body of a chunked request contains a Blob, while a non-chunked request
message-body contains a File (assuming the file is not a scaled version and
the original file is not a Blob itself).</p>
<p>This means that, even if chunking is enabled, a chunked upload request is
only sent to traditional endpoints if the associated file can be broken into
more than 1 chunk. This behavior is consistent with the way all other
endpoints have functioned. Previously, a chunked request would always be
sent for traditional endpoints if chunking was supported and enabled.</p>
<h3 id="drawthumbnail-api-method-only-passes-one-argument-to-rejected-promise-callback"><code>drawThumbnail</code> API method only passes one argument to rejected promise callback</h3>
<p>This was done to bring the API that Fine Uploader exposes in compliance with the A+ promises spec. While
<code>qq.Promise</code> is not A+ compliant, use of other promise implementations when communicating with Fine Uploader
is now supported. Since the spec indicates that only one argument can be passed to a resolve or reject callback,
the promise returned by the <a href="api/methods.html#drawThumbnail"><code>drawThumbnail</code> API method</a> had to be modified. The resolve callback
already was only passed one argument (the container element), this breaking change only affects the reject callback.
Previously, two arguments were passed, in the event of an error, to the reject callback: the container element, and
an error message. Now, an object with <code>container</code> and <code>error</code> properties is the only argument.</p>
</div>
</div>
</div> <!-- /container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<!--
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
-->
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script>
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(100643192);
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100643192ns.gif" /></p></noscript>
<script src="/branch/master/_static/js/main.js"></script>
<script src="/branch/master/_static/js/navbar.js"></script>
</body>
</html>