我想尝试最新的Firebase现在有存储,但我收到此错误"无法连接到服务器.请在几分钟后重试.重试"当我转到新的控制台,存储,文件.
我该如何解决这个问题?谢谢.
我正在尝试将我添加到Android设备上的firebase存储中的图像拉入其中.每次运行时我都会收到此错误onFailureListener()
E/StorageException(9646):发生未知错误,请检查HTTP结果代码和服务器响应的内部异常.E/StorageException(9646):代码:-13000 HttpResult:0
我还将存储权限更改为暂时具有读/写功能,以确保不是问题.
final ImageView test = (ImageView) findViewById(R.id.test_image);
StorageReference ref = storage.getReferenceFromUrl("gs://my-project.appspot.com/test_image.png");
ref.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
Log.d(TAG, "Successfully loaded uri");
test.setImageURI(uri);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.d(TAG, "Failed loaded uri: " + e.getMessage());
}
});
Run Code Online (Sandbox Code Playgroud) 有没有办法用firebase.storage()移动文件?
示例:user1/public/image.jpg到user1/private/image.jpg
我正在使用本地反应,我需要使用Firebase存储将图像上传到Firebase .我正在使用react-native-image-picker从手机中选择图像,它为我提供了base64编码数据.
当我尝试将图像上传到Firebase时它会给我错误,Firebase Storage: String does not match format 'base64': Invalid character found但我已经检查过该字符串是否是带有正则表达式的有效base64字符串,它是!
我已经从这里读了几个答案,但我尝试了所有这些.这是我的代码:
function uploadImage(image){
const user = getCurrentUser();
const refImage = app.storage().ref(`profileImages/${user.uid}`);
refImage.putString(image, 'base64').then(() => {
console.log('Image uploaded');
});
}
Run Code Online (Sandbox Code Playgroud)
图像选择器:
ImagePicker.showImagePicker(ImageOptions, (response) => {
if (response.didCancel) {
console.log('User cancelled image picker');
}
else if (response.error) {
console.log('ImagePicker Error: ', response.error);
}
else if (response.customButton) {
console.log('User tapped custom button: ', response.customButton);
}
else {
uploadImage(response.data);
}
});
Run Code Online (Sandbox Code Playgroud) 我在网络Firebase上找不到像'getReferenceFromUrl'这样的功能.我已经为我的数据库中的每个项目存储了对URL(而不是图像名称)的引用.
是否有任何解决方法可以使用URL获取图像的引用?
我正在制作一个聊天室应用程序,到目前为止它能够发送消息、图像和视频。
\n我使用非常相似的方法来发送视频并且它有效,但在发送音频时它不起作用。
\n音频文件和音频网址已成功上传到 Firebase,但是当我尝试播放音频时,它显示此错误:操作无法\xe2\x80\x99t 完成。(操作系统状态错误 2003334207。)。
\n该项目变得非常庞大,而且我使用 AVAudio 的经验很少,所以如果你们以前遇到过类似的问题,请教我如何解决它。谢谢!!!
\n这是设置audioRecorder的代码,我在这里获取url并将其传递给其他函数以将音频文件放入Firebase存储中。
\nfunc startRecording() {\n let settings = [\n AVFormatIDKey: Int(kAudioFormatMPEG4AAC),\n AVSampleRateKey: 12000,\n AVNumberOfChannelsKey: 1,\n AVEncoderAudioQualityKey: AVAudioQuality.low.rawValue\n ]\n \n do {\n let audioFileUrl = getAudiFileURL()\n audioRecorder = try AVAudioRecorder(url: audioFileUrl, settings: settings)\n audioRecorder.delegate = self\n audioRecorder.record()\n blackView.isHidden = false\n } catch {\n finishRecording(success: false)\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n这是我尝试将音频文件上传到 Firebase 存储的地方,它确实打印出了正确的 downloadURL。(URL 指向文件在 iOS 设备中的位置。)
\nfunc handleAudioSendWith(url: String) {\n guard let fileUrl = URL(string: url) else {\n return\n …Run Code Online (Sandbox Code Playgroud) 我已成功测试Firebase功能以进行存储.但是,我没有看到任何提示如何仅在将文件添加到我的存储桶中的文件夹时调用该函数.我已经看到了关于划定范围的功能,唯一的暗示是不同的桶在这里.
是否可以将功能范围扩展到我的存储桶中的文件夹,如果是,如何?或者我需要多个存储桶而不是文件夹来分隔不同的任务.
google-cloud-storage firebase google-cloud-functions firebase-storage
我正在使用react-native-firebase与我们的Firebase帐户一起使用身份验证,防火墙和存储.尝试将照片上传到存储失败,出现未知错误.这是尝试的代码:
_pickImage = async () => {
await this.getCameraRollPermission()
let result = await ImagePicker.launchImageLibraryAsync({
allowsEditing: true,
aspect: [4, 3],
});
console.log(result);
if (!result.cancelled) {
// this.setState({ photoURL: result.uri });
this._handlePhotoChoice(result)
}
};
_handlePhotoChoice = async pickerResult => {
let userId = this.state.userId
firebase
.storage()
.ref('photos/profile_' + userId + '.jpg')
.putFile(pickerResult.uri)
.then(uploadedFile => {
console.log("Firebase profile photo uploaded successfully")
})
.catch(error => {
console.log("Firebase profile upload failed: " + error)
})
}
Run Code Online (Sandbox Code Playgroud)
在iOS模拟器中测试并使用调试器来检测错误我刚刚收到此错误:
"Error: An unknown error has occurred. …Run Code Online (Sandbox Code Playgroud) ios firebase react-native firebase-storage react-native-firebase
我目前正在开发适用于 Android 移动设备的社交媒体应用程序,但我在应用程序的成本效率方面存在问题,尤其是使用 Firebase Storage。因此,我想为 Firebase 实现一个 CDN,它可以缓存视频和图像,最好使用提供可扩展定价的 CDN 服务(Google CDN 提供此价格模型)。我一直在到处搜索如何使用 Firebase Storage 实现 google CDN,但没有找到明确的说明。我怎样才能做到这一点?
google-cloud-storage firebase google-cloud-platform firebase-storage google-cloud-cdn
我正在开发一个新项目,问题是即使我不使用它,我的 firebase 存储也在逐渐填满,现在它有 4,1 GB 大。
我没有创建一个存储桶,它正在填满。
我试图做的一件事是查看云控制台中的文件,但所有这些文件的格式都很奇怪,我无法打开。
直到现在,我什至不与可能占据该空间的媒体合作。
我很感激如何回溯使用的想法。