昨天我测试了我的应用程序,上传功能没有问题,今天因为我做了一些更改它停止了工作,然后我撤消了更改,应用程序仍然没有上传
bUpload = (Button) view.findViewById(R.id.bUpload);
bUpload.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bUpload:
Bitmap image = ((BitmapDrawable) UploadFile.getDrawable()).getBitmap();
new UploadFile(image, FileSelector.getText().toString());
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
byte[] FiletoUpload = stream.toByteArray();
ParseFile File = new ParseFile("file1.jpeg", FiletoUpload);
File.saveInBackground();
ParseObject UploadedFiles = new ParseObject("UploadedFiles");
UploadedFiles.put("ImageName", "Uploaded Files");
UploadedFiles.put("ImageFile", File);
UploadedFiles.saveInBackground();
Toast.makeText(getActivity(), "File Uploaded Successfully",
Toast.LENGTH_SHORT).show();
break;
}
}
});