File upload design

  • define $scope.files as model in the tag -> tell system that the files selected/draged will apply to this variable
  • use $watch to monitor the change of files, invoke uploadFile.upload() function whenever it’s changed
  • fill in the corresponding parameters in the function call to finish the work

Parameters

  • post url
    • is it fixed?
    • host/port need to be changed at least for each installation
    • host/port can be got from api,
    • will “/api/Offer/upload” be changed?
    • can make this one as parameter, just in case it will be changed
    • this change will be only in service, so just change in 1 place, can hard code it for now, but get host/port automatically
  • file url
    • use the defined pattern
    • user name in the path, people not supposed to see other’s file
    • host:port/files/username/filename
    • no need to pass the parameter there
  • which file name to use?
    • it’s original file name?
      • may override file
    • give new file name automatically? random
      • will not override old file
    • define new name per each field?
  • show picture vs. show url
    • picture is good
      • need to show thumbnail
      • click 2 show the full picture
    • good to show the url
      • make it readonly?
  • thumbnail
  • ng-model variable
    • need to pass it as different controller may use different variable
  • need to limit the size
    • limited by the attribute
  • need to limit the type
    • limited by the attribute
  • to show progress or not?
    • better to show it
  • add the
Advertisements
This entry was posted in Design. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s