Share your repls and programming experiences

← Back to all posts
Image Hosting Service on Repl.it!
MarcusWeinberger

This is a fairly simple yet over-complicated image hosting service.

Located at: https://img.marcusweinberger.repl.co (web interface)

Here's an example: https://img.marcusweinberger.repl.co/download/0b8a

it can also be used from the command line! (untested)

curl -F ‘[email protected]/to/local/file’ https://img.marcusweinberger.repl.co/upload

I will briefly explain some potentially confusing parts:

storage.py: This is a custom client for jsonstore.io that I wrote, it lets you store large amounts of data easily, if you want, you can copy it and use it in your own projects. The reason I needs to use this is because repl.it doesn't let you save files when running in project mode so this allows for persistence.

client.py: This is a simple client I wrote for my own service while testing

form.html: This is a very, very simple web page that allows the user to upload an image. It contains a special variable that tells the server to redirect the user to the URL that the image is located at, because from the terminal you just want it to return the URL, and not the data. It is served as the index of the page.

Voters
zaidan
21natzil
AphixDev
PaoloAmoroso
DieselJS
UrM0MLol
Tru_Dev
Kai_Justice
amasad
Safariminer
Comments
hotnewtop
JordanDixon1

(sorry for being random) Do you know PHP? If so, I need help making a login/register system. I don't know how to save credentials in jsonstore.io

JordanDixon1

@JordanDixon1 This is pretty cool btw.

MarcusWeinberger

@JordanDixon1 sorry I know no PHP whatsoever lol

JordanDixon1

@MarcusWeinberger That's ok. Thanks anyway!
Wait... Do you know how to do this with html? ._.

Haaruun

@JordanDixon1 I used to do allot of php send me an invite and ill help out

Haaruun

@JordanDixon1 Though just plain html would work better

JordanDixon1

@Haaruun Ok, I actually deleted the file so we're gonna have to start from scratch.

AphixDev

@JordanDixon1 Do you know what coding language I should use to store info in databases for c++

JordanDixon1

@nt998302 I do not

[deleted]

@nt998302 use PHP and MYSQL if you are doing auth

JordanDixon1

@sanjaykdragon I don't know any MySQL at all. And repl.it doesn't support that unless it is a remote one.

AphixDev

@sanjaykdragon Thanks :). Not sure what auth means, but I'm trying to create save files linked to accounts. Will PHP work? I know a bit of php and sql but I'm more comfortable w/ php

JordanDixon1

@nt998302 PHP goes hand-in-hand with MySQL. MySQL is just a storage for whatever the PHP puts there and when PHP needs the info/data again it asks for it from the MySQL.

AphixDev

@JordanDixon1 Okay, thanks! :)

AphixDev

This is a great program. There are a lot of bugs and errors, but that's how you get better. Keep up the great work!

MarcusWeinberger

@nt998302 thank you, I'm actually planning on scrapping it completely and rebuilding it from scratch, hopefully much, much better. What sorta bugs have you come across?

AphixDev

@MarcusWeinberger Yesterday, the program didn't run, but I see that you fixed that. When I tried it today, it couldn't access the image that I chose and said that the file could not be found.

MarcusWeinberger

@nt998302 oh it's possible a change I made affecting how often images were saved did that. After posting this here I realised that the way I did things really doesn't work well so don't rely on this project, I'm rewriting it though to be better

ThnksCJ

Replit: Updating package configuration

--> python3 -m poetry lock

RuntimeError

The Poetry configuration is invalid:
- 'description' is a required property

at /opt/virtualenvs/python3/lib/python3.8/site-packages/poetry/core/factory.py:43 in create_poetry
39│ message = ""
40│ for error in check_result["errors"]:
41│ message += " - {}\n".format(error)
42│
→ 43│ raise RuntimeError("The Poetry configuration is invalid:\n" + message)
44│
45│ # Load package
46│ name = local_config["name"]
47│ version = local_config["version"]
exit status 1

Replit: Package operation failed.

I get this error when trying to do it do you know why?

MarcusWeinberger

@ThnksCJ this project has been deprecated and no longer is maintained. However I believe that error is from the poetry package not having a description

ThnksCJ

@MarcusWeinberger could you please fix it i would love to use the code

MarcusWeinberger

@ThnksCJ sorry, but the data storage service it depends on (jsonstore) is no longer being run, so it can't be fixed.

ThnksCJ

@MarcusWeinberger why does your work and mine doesnt

MarcusWeinberger

@ThnksCJ mine does not either

KeironTravis

File "main.py", line 100
res = "
^
SyntaxError: EOL while scanning string literal

HackermonDev

Doesn't work

AphixDev

@PDanielY Same here. It sends an error message each time

Zavexeon

@PDanielY If I remember correctly, a repl cannot save a file unless you're actually in the repl. That meaning that you can't upload and save files to a server on repl.it.

HackermonDev

@Zavexeon Looks like I am the second person to do this: https://repl.it/@PDanielY/Image-Uploader (first is imag.cf)

Zavexeon

@PDanielY Is it actually being saved to the repl?

HackermonDev

@Zavexeon yep. Congrats on 666 karma

MarcusWeinberger

@Zavexeon I use jsonstore.io and a modified client for persistence

thejoeman24

my image no upload

MarcusWeinberger