Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 863863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:22:47+00:00 2026-05-15T09:22:47+00:00

I am trying to design a RESTful filesystem-like service, and copy/move operations are causing

  • 0

I am trying to design a RESTful filesystem-like service, and copy/move operations are causing me some trouble.

First of all, uploading a new file is done using a PUT to the file’s ultimate URL:

PUT /folders/42/contents/<name>

The question is, what if the new file already resides on the system under a different URL?

Copy/move Idea 1: PUTs with custom headers.

This is similar to S3’s copy. A PUT that looks the same as the upload, but with a custom header:

PUT /folders/42/contents/<name>
X-custom-source: /files/5

This is nice because it’s easy to change the file’s name at copy/move time. However, S3 doesn’t offer a move operation, perhaps because a move using this scheme won’t be idempotent.

Copy/move Idea 2: POST to parent folder.

This is similar to the Google Docs copy. A POST to the destination folder with XML content describing the source file:

POST /folders/42/contents
...
<source>/files/5</source>
<newName>foo</newName>

I might be able to POST to the file’s new URL to change its name..? Otherwise I’m stuck with specifying a new name in the XML content, which amplifies the RPCness of this idea. It’s also not as consistent with the upload operation as idea 1.

Ultimately I’m looking for something that’s easy to use and understand, so in addition to criticism of the above, new ideas are certainly welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:22:47+00:00Added an answer on May 15, 2026 at 9:22 am

    The HTTP spec says if the resource already exists then you update the resource and return 200.
    If the resource doesn’t exist then you create it and you return 201.

    Edit:
    Ok, I misread. I prefer the POST to the parent folder approach. You could also refer to the source file using a query string parameter. e.g.

    POST /destination/folder?sourceFile=/source/folder/filename.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to wrap my head around RESTful design, and I'd like to understand
I'm a new REST convert and I'm trying to design my first RESTful (hopefully)
I'm trying to design some images and button images for an Android app. But
I'm trying to design some tables to store some data, which has to be
I’m trying to develop a online shopping web service with RESTful. However, I’m so
I've been trying to design support for recurring events (like you would see in
I am trying to design some kind of user to user relationship, such as
I'm trying to design a RESTful API where the users can fetch a single
I'm trying to use AppEngine as sort of a RESTful web service. The service
I am trying to develop a client application that calls a RESTful web service.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.