Backendless Support
 
Waiting for user's response

how can I upload an image file into backendless and how the file reference field in the table to be

how can I upload an image file into backendless and how the file reference field in the table to be updated?

for example: I have a table named Items. and in that table there is a field 'Item_Image' as file reference. How can I Store the image in the item_image field. I am using .Net. How can I upload and retrieve an image from backendless from .Net Application?

Leave a Comment

Comments (6)

photo
1

Hi Riyaz

Looks like this is duplicated topic

http://support.backendless.com/topic/save-and-retrieve-a-image-file-in-backendless#comment-27735

Follow by this steps:

1) upload a new image file -> server return fileUrl

2) update/create a new item in your table "Items" with "Item_Image: fileUrl"

3) retrieve this "item"

4) get property "Item_Image" of "item" (this is url to the uploaded file)

So if you have problems with specific step/steps, please let us know and we will try to investigate this specific steps

Regards, Vlad

photo
1

Hai dear,

Uploading a new image file from my .net application is done. and it is uploaded in the files in backendless server. But how can I get the fileUrl of that image file from server

photo
1

Ok,

This is example from our docs

https://backendless.com/documentation/files/dotnet/files_file_upload.htm

  1. AsyncCallback<BackendlessAPI.File.BackendlessFile> callback = new AsyncCallback<BackendlessAPI.File.BackendlessFile>(
  2. result => {
  3. //save result.FileURL to where you want
  4. System.Console.WriteLine( "File uploaded. URL - " + result.FileURL );
  5. },
  6. fault => {
  7. System.Console.WriteLine( "Error - " + fault );
  8. } );
  9. FileStream fs = new FileStream("yourImgName.jpg", FileMode.Open, FileAccess.Read );
  10. BackendlessAPI.Backendless.Files.Upload( fs, "imgDirectoryName", callback );

photo
1

and as result:

result.FileURL => 'https://api.backendless.com/4964D91B-B4BC-E583-FFE4-2312312/v1/files/imgDirectoryName/yourImgName.jpg'

photo
photo
1

If you dont mind please show me a example with .Net Code

photo
1

File upload API and example are available in the documentation:

https://backendless.com/documentation/files/dotnet/files_file_upload.htm

photo