Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting an expiration date when uploading a file #970

Closed
4 tasks done
jimSampica opened this issue Dec 6, 2024 · 4 comments
Closed
4 tasks done

Setting an expiration date when uploading a file #970

jimSampica opened this issue Dec 6, 2024 · 4 comments
Assignees
Labels

Comments

@jimSampica
Copy link

jimSampica commented Dec 6, 2024

Description of the Issue

Is there a way to set an expiration date when uploading a file? I basically want to do something like this...

I can do this when managing files directly in box through the file context menu, as seen below.

var fileRequest = new BoxFileRequest
{
    Name = "test.pdf",
    ExpirationAt = DateTimeOffset.Now.AddDays(1) // ExpirationAt doesn't exist
};

await boxClient.FilesManager.UploadAsync(fileRequest, fileContents);

Steps to Reproduce

N/A

Expected Behavior

N/A

Error Message, Including Stack Trace

N/A

Screenshots

image
image

Versions Used

.Net SDK: 5.8.0
Windows: Windows Server 2022

@lukaszsocha2
Copy link
Contributor

Hi @jamesSampica,
unfortunately Box API currently doesn't support setting expiration during upload (API docs) or updating the file (API docs).
You can try to achieve something similar using Retention Policy with "permanently_delete" disposition action. See docs for more details.
Best,
@lukaszsocha2

@jimSampica
Copy link
Author

Thanks for getting back to me. Is this something that is supported in the newer generated SDK or can I put in an enhancement to support this here or somewhere else?

@lukaszsocha2
Copy link
Contributor

Hi, this in not supported by Box API so it cannot be supported by any SDK. You can submit a post on Box Pulse to add API support for this field. If it gets many votes, maybe your query will be prioritised.

@jimSampica
Copy link
Author

Got ya, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants