MCPcopy
hub / github.com/streamlit/streamlit / fetchFileURLs

Method fetchFileURLs

frontend/lib/src/FileUploadClient.ts:144–156  ·  view source on GitHub ↗

* Request that the app fetch URLs to upload/delete/get the given files. Once * this is done, the app should call this class' onFileURLsResponse to * signify completion. * * @param files: An array of files. * * @return a Promise resolving to a list of

(files: File[])

Source from the content-addressed store, hash-verified

142 * URLs for uploading and deleting the given files.
143 */
144 public fetchFileURLs(files: File[]): Promise<IFileURLs[]> {
145 if (!this.requestFileURLs) {
146 return Promise.resolve([])
147 }
148
149 const resolver = Promise.withResolvers<IFileURLs[]>()
150
151 const requestId = uuidv4()
152 this.pendingFileURLsRequests.set(requestId, resolver)
153 this.requestFileURLs(requestId, files)
154
155 return resolver.promise
156 }
157
158 /**
159 * Callback to be called by the app once the file URLs corresponding to a

Callers 6

CameraInputFunction · 0.80
ChatInputFunction · 0.80
createDropHandlerFunction · 0.80
FileUploaderFunction · 0.80
uploadFilesFunction · 0.80

Calls 2

withResolversMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected