Arc Forumnew | comments | leaders | submitlogin
How do I upload files in Arc?
3 points by lark 4442 days ago | 16 comments
I see older threads around this, but they refer to Anarki and 3rd party plugins.

http://arclanguage.org/item?id=11436

This means searching, githubbing, compiling, things breaking, whatever. After messing with ffi and not getting that to work, I don't want to deal with any of this.

Is there a single file that adds an upload feature to Arc?



1 point by akkartik 4441 days ago | link

You'll have to try http://github.com/nex3/arc/blob/master/lib/webupload.arc like that link said. Arc is all about messing around.

-----

1 point by lark 4437 days ago | link

To use webupload.arc, one needs to first include aform-multi (and the enctype attribute) from Anarki into Arc 3.1.

Then, uploading a 679k file reports the following in the repl output:

  Can't coerce "S?" int
Uploading a 23-byte file reports the following into the repl:

  >: expects type <real number> as 1st argument, given: nil; other arguments were: 0

and the following on the webpage output:

  ... headers ... 
  Content-Type: nil 
  Content-Length: nil 
  ... more headers ... 

So it doesn't work. There's no clen in the request deftem, and that requires modifying srv.arc

It seems the proposition is to use Anarki in its entirety, rather than Arc. What are the implications?

-----

1 point by akkartik 4436 days ago | link

Hmm, are you able to get webupload.arc to work in just anarki?

-----

1 point by lark 4435 days ago | link

Running anarki with mzscheme 372 does not work. Starting anarki with pg's instructions reports:

  require: unknown module: racket/unsafe/ops
Installing the latest racket 5.2.1 to work with anarki is causing trouble too. I see the following (which had no resolution): http://arclanguage.org/item?id=12146

...but in my local dir ~/racket. Basically:

  ~/racket/bin$ ./racket 
  -bash: ./racket: No such file or directory
Trying to start plain anarki also causes trouble:

  $ ./arc.sh 
  ./arc.sh: line 7: type: rlwrap: not found
  ./arc.sh: line 11: /home/akkartik/racket/bin/racket: No such file or directory

  $ ls -lrtah /home/akkartik/racket/bin/racket
  -rwxr-xr-x 1 rouge rouge 3.4M Feb  2 08:48 /home/akkartik/racket/bin/racket

Is it possible to tell anarki which mzscheme to use?

-----

1 point by akkartik 4435 days ago | link

Yes, you need to run anarki with racket. I typically simply install racket, clone anarki, cd into that dir, and then run:

  $ racket -f as.scm
Does that work for you?

---

"bash: ./racket: No such file or directory"

Weird indeed. What do you get if you type this in?

  $ file `which racket`
What version of linux or macos are you on? (If you're on windows that's beyond my experience.)

---

I just searched anarki and I don't seem to have leaked my homedir in the scripts or anything like that. Did you deliberately create that /home/akkartik directory?

-----

1 point by lark 4435 days ago | link

It doesn't work. racket doesn't run

  $ racket -f as.scm 
  -bash: racket: command not found
---

  $ file `which racket`
  /home/akkartik/racket/bin/racket: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
---

Yes, I'm using it as an example of my home directory name. Bad example it seems.

---

I have a 4.2.1 mzscheme, and that reports:

  $ mzscheme -f as.scm 
  ac.scm:1323:9: racket/unsafe/ops: standard-module-name-resolver: collection not found: #<path:racket/unsafe> in any of: (#<path:/home/lark/.plt-scheme/4.2.1/collects> #<path:/usr/lib/plt/collects>) in: racket/unsafe/ops

-----

1 point by akkartik 4435 days ago | link

Thanks for that info. Yeah it may not work with mzscheme because that's a legacy language.

Can you tell me what version of linux you're using?

All my servers are 32-bit linux, so I'm not sure what's going on. Googling around, are any of the answers here useful?

http://superuser.com/questions/248512/why-do-i-get-command-n...

-----

1 point by lark 4435 days ago | link

I must be on a 32-bit linux.

  $ uname -m
  i686
All right, compiling racket...

Can I ask why anarki does not work with mzscheme 372? Arc works with it.

-----

1 point by akkartik 4435 days ago | link

I'm sure there's a 32-bit version you can download.

"Can I ask why anarki does not work with mzscheme 372? Arc works with it."

Yeah, I misspoke. I meant that I don't know if anarki works with mzscheme because I haven't tried it in forever and the default anarki instructions are to use racket.

I'm pretty sure it won't work with v372, that's a really old version. I believe pairs used to be mutable by default back then. Or perhaps they were immutable, but that was a big transition and I'm sure there were bugfixes.

And if you're going to install a more recent version of racket, might as well just run racket since it gets the most eyeballs on bugs. The community seems to have converged on racket as well. Testing resources are scarce; easier to just focus on one configuration.

BTW, are you aware of the wiki? http://sites.google.com/site/arclanguagewiki

-----

1 point by lark 4435 days ago | link

There is a 32-bit version I can download -- just not for Debian.

Building from source gets me to:

... raco setup: 0 making: tests/mzcom raco setup: 0 making: tests/match Racket virtual machine has run out of memory; aborting

Enough.

-----

1 point by akkartik 4435 days ago | link

That's too bad. My commiserations.

Edit: Hmm, I run mint which is based on debian. What am I doing? I think I just downloaded the ubuntu version. It's not like it's a real deb and installs in system dirs anyway.

-----

1 point by lark 4434 days ago | link

Oh you legacy programs, you'll be the death of me.

-----

1 point by akkartik 4434 days ago | link

Did installing the ubuntu version of racket work?

-----

2 points by lark 4431 days ago | link

Anarki runs now, found a package. Thanks for the help.

-----

1 point by akkartik 4431 days ago | link

Awesome! Can you share more details?

-----

1 point by lark 4425 days ago | link

I installed racket 5.2.1+dfsg1-4 from Debian sid.

It makes Anarki start without problems.

-----