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 6892219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:30:27+00:00 2026-05-27T06:30:27+00:00

I am trying to implement file upload/download via a javascript application written with Backbone.js

  • 0

I am trying to implement file upload/download via a javascript application written with Backbone.js + jQuery. The server is set up as a REST server (as needed by Backbone) to accept get requests as specified below.

Example HTTP gets are:

GET /     #This means get all the files in the root directory
GET /foo/ #This means get all the files in the foo firectory
GET /bar  #This means get the bar file

I want the client application to lazy load the directory information (essentially on request). In the backbone framework I have set up a model called ‘Item’. Item contains a field called type which specifies what type of item it is. If the type is ‘folder’ then I want to be able to list files in that folder. How do I get backbone to output different gets depending on the information in the Model?

  • 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-27T06:30:28+00:00Added an answer on May 27, 2026 at 6:30 am

    If I understand you correctly you need to call a different URL based on the the current attributes set on a model.

    You can do this by overriding the url() function on the Item model. So you might end up with something like this on your Item model:

    url: function() {
      switch(this.get('type')) {
      case: 'foo':
        return '/foo';
        break;
      case: 'bar':
        return '/bar';
        break;
      default:
        return '/';
      }
    }
    

    Scott

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement an Asynchronous file download from a web server using
I'm trying to implement file upload functionality in the iPhone app. Server code is
I am trying to implement some WCF and REST services to upload a file
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
I have an application where I am trying to implement a safe file overwrite
So Im trying to implement a file upload functionality where when a user uploads
After painstakingly trying to implement TCP file transfer in my conference chat application using
I am trying to implement a multiple file upload where I am right now
I'm trying to implement the well-known method used to upload files to a server
I am trying to implement file upload functionality on my site. I have created

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.