#1044 closed defect (fixed)

Unable to upload c file to marketplace

Reported by: wojciech Owned by: tim
Priority: major Milestone: SasView 4.2.0
Component: sasmodels Markeplace Keywords:
Cc: Work Package: SasView Bug Fixing

Description

When trying to upload c file to marketplace I get following error:

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python']. 

However accoriding to MAC filetype is correct, e.g.

file -I barbell.c
barbell.c: text/x-c; charset=us-ascii

Change History (16)

comment:1 Changed 19 months ago by butler

  • Owner set to tim
  • Status changed from new to assigned

comment:2 Changed 19 months ago by wojciech

I've checked it again and there still seems to be an issue.

comment:3 Changed 19 months ago by wojciech

I've also asked colleague with OSX to test and she reports same error

comment:4 Changed 19 months ago by tim

I've not encountered any problems with this (running 10.13.3), however, it's treating the .c file as ASCII text; perhaps if there's a program that 'owns' the .c extension it might modify its behaviour?

comment:5 Changed 19 months ago by wojciech

I've tested it on 10.11 and 10.12 (don't have access to 10.13) and on both I've encoutered the problem. However, it seems to be the issue with some models, e.g. cylinder.c and barbell.c fail to upload while core_shell_sphere.c works.

I've tested fresh (pulled from github) models as I thought that editing program modifies the extenstion but it doesn't seem to be the case.

comment:6 Changed 19 months ago by ajj

Notes from discussion at conf call:

  • Does Linux have this problem?
  • Check executable bit
  • File encoding?

comment:7 Changed 19 months ago by awashington

I can confirm the same error message under Nixos using Firefox as the browser. Just from the error message, it looks like the server isn't getting the expected mime type.

comment:8 Changed 19 months ago by awashington

Just checking around a bit, my system assigns the mime-type text/plain to .c files, so the server is correctly getting the data sent by the client. I'm thinking that our best bet is to update the marketplace to accept text/plain files as well?

comment:9 Changed 19 months ago by awashington

I've submitted a pull request on sasmodel-marketplace that should correct the issue.

comment:10 Changed 18 months ago by wojciech

I suppose the fix should work now as it should be automatically deployed on the marketplace server?
I still cannot upload some of the c files.

comment:11 Changed 18 months ago by awashington

I have just confirmed that I can upload C files to the server from Linux, which I was not able to do before the fix. Are you still getting the error message

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python'].


comment:12 Changed 18 months ago by wojciech

Yes, I am stil getting the same error:
Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python'].

comment:13 Changed 17 months ago by wojciech

It doesn't work for most of the models (e.g. cylinder, barbell, bcc_paracryystal, capped_cylinder). I haven't check them all but two models that I know I can upload are: hollow_rectangular_prism_thin_walls and rectangular_prism.

comment:14 Changed 17 months ago by wojciech

Clearing cache doesn't help. Using Safari doesn't make it work either.

comment:15 Changed 14 months ago by butler

  • Summary changed from Unable to upload c file to marketplace from MAC to Unable to upload c file to marketplace

Just tried manually updating the core_shell_parallelepiped model since we have fixed the incorrect code. I am using a Dell windows PC running Windows 7 Enterprise. I successfully deleted the c and py files and uploaded the new py file. I was also able to update the description. However when trying to upload the c file I get the same error as follows:

Files of type text/plain cannot be uploaded. Please select a file of type ['text/x-c', 'text/x-python']

Am updating the title of the ticket since it is clearly not just macs.

comment:16 Changed 13 months ago by tim

  • Resolution set to fixed
  • Status changed from assigned to closed

This has been 'fixed', more details can be found here: http://trac.sasview.org/wiki/DevNotes/Processeses/MarketplaceDeployment

Note: See TracTickets for help on using tickets.