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
If you use `api_struct` gem in your project, replace it with `uploadcare-api_struct`:
77
+
76
78
```ruby
77
79
gem 'uploadcare-api_struct'
78
80
```
81
+
79
82
and run `bundle install`
80
83
81
84
If already not, create your project in [Uploadcare dashboard](https://app.uploadcare.com/?utm_source=github&utm_medium=referral&utm_campaign=uploadcare-ruby) and copy
82
85
its [API keys](https://app.uploadcare.com/projects/-/api-keys/) from there.
83
86
84
87
Set your Uploadcare keys in config file or through environment variables:
88
+
85
89
```bash
86
90
export UPLOADCARE_PUBLIC_KEY=your_public_key
87
91
export UPLOADCARE_SECRET_KEY=your_private_key
@@ -107,6 +111,7 @@ and [Upload](https://uploadcare.com/api-refs/upload-api/) and [REST](https://upl
107
111
You can also find an example project [here](https://github.com/uploadcare/uploadcare-rails-example).
108
112
109
113
### Uploading files
114
+
110
115
#### Uploading and storing a single file
111
116
112
117
Using Uploadcare is simple, and here are the basics of handling files.
@@ -122,9 +127,17 @@ Using Uploadcare is simple, and here are the basics of handling files.
122
127
# URL for the file, can be used with your website or app right away
The `store` option can have these possible values:
140
+
128
141
-`true`: mark the uploaded file as stored.
129
142
-`false`: do not mark the uploaded file as stored and remove it after 24 hours.
130
143
-`"auto"`: defers the choice of storage behavior to the [auto-store setting](https://app.uploadcare.com/projects/-/settings/#storage) for your Uploadcare project. This is the default behavior.
This method accepts options to set properties of an output file:
667
701
668
702
-**uuid** — the file UUID-identifier.
@@ -700,7 +734,9 @@ This method accepts options to set properties of an output file:
700
734
:problems=>{}
701
735
}
702
736
```
737
+
703
738
Params in the response:
739
+
704
740
-**result** - info related to your transformed output(-s):
705
741
-**original_source** - built path for a particular video with all the conversion operations and parameters.
706
742
-**token** - a processing job token that can be used to get a [job status](https://uploadcare.com/docs/transformations/video-encoding/#status) (see below).
-**status** - processing job status, can have one of the following values:
745
-
-*pending* — video file is being prepared for conversion.
746
-
-*processing* — video file processing is in progress.
747
-
-*finished* — the processing is finished.
748
-
-*failed* — we failed to process the video, see error for details.
749
-
-*canceled* — video processing was canceled.
782
+
-_pending_ — video file is being prepared for conversion.
783
+
-_processing_ — video file processing is in progress.
784
+
-_finished_ — the processing is finished.
785
+
-_failed_ — we failed to process the video, see error for details.
786
+
-_canceled_ — video processing was canceled.
750
787
-**error** - holds a processing error if we failed to handle your video.
751
788
-**result** - repeats the contents of your processing output.
752
789
-**thumbnails_group_uuid** - holds :uuid-thumb-group, a UUID of a file group with thumbnails for an output video, based on the thumbs operation parameters.
@@ -759,6 +796,7 @@ More examples and options can be found [here](https://uploadcare.com/docs/transf
759
796
After each document file upload you obtain a file identifier in UUID format.
760
797
761
798
You can use file identifier to determine the document format and possible conversion formats.
or create an image of a particular page (if using image format):
827
+
788
828
```ruby
789
829
Uploadcare::DocumentConverter.convert(
790
830
[
@@ -817,7 +857,9 @@ This method accepts options to set properties of an output file:
817
857
:problems=>{}
818
858
}
819
859
```
860
+
820
861
Params in the response:
862
+
821
863
-**result** - info related to your transformed output(-s):
822
864
-**original_source** - source file identifier including a target format, if present.
823
865
-**token** - a processing job token that can be used to get a [job status](https://uploadcare.com/docs/transformations/document-conversion/#status) (see below).
@@ -841,6 +883,7 @@ To check a status of a document processing job you can simply use appropriate me
841
883
token =21120220
842
884
Uploadcare::DocumentConverter.status(token)
843
885
```
886
+
844
887
`token` here is a processing job token, obtained in a response of a convert document request.
0 commit comments