You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var request:URLRequest = new URLRequest("https://firebasestorage.googleapis.com/v0/b/<YOUR-PROJECT-ID>.appspot.com/o/pictures%2F"+"heavy_picture.jpg");
182
+
request.method = URLRequestMethod.POST;
183
+
request.data = bytes.toString();
184
+
request.contentType = "image/jpeg";
185
+
186
+
file.uploadUnencoded(request);
187
+
}
188
+
189
+
private function progressHandler(event:ProgressEvent):void
190
+
{
191
+
var progress:Number = Math.round((event.bytesLoaded/event.bytesTotal)*100);
192
+
trace("Upload Progress: " + progress + "%");
193
+
}
194
+
195
+
private function uploadCompleteDataHandler(event:DataEvent):void
196
+
{
197
+
trace(event.data); //Here you will receive the file metadata from Firebase Storage.
198
+
}
199
+
```
200
+
201
+
It is required to send the file as a `String` that represents the file bytes and use the `uploadEncoded` method.
202
+
160
203
## Uploading with Auth
161
204
162
205
Authorizing requests for Firebase Storage is a bit different than in Firebase Database. Instead of adding an `auth` parameter in the URL with the `authToken`, we add it into a header.
0 commit comments