14 votes

Get image from other site in PHP

Your code is vulnerable to LFI and XSS. http://localhost/yourscript.php?url=../../../../../../etc/passwd This would load the local file /etc/passwd and display ...
tim's user avatar
  • 25.1k
10 votes
Accepted

VIM colors downloader in Python

Very nice code in general! Here are a few points, though: Think about using os.makedirs instead of os.mkdir. The former allows ...
Graipher's user avatar
  • 40.9k
8 votes

VIM colors downloader in Python

Nice script! A few points on top of what @Graipher already pointed out. Passing url parameters to requests This is a hacky way to pass query parameters: ...
janos's user avatar
  • 111k
7 votes
Accepted

SFTP Ruby script for downloading files from server

One of the core elements your code is missing is object-orientation. Take advantage of Ruby's powerful object model. That alone will vastly improve what you have. What we're going to do is ...
Damien's user avatar
  • 335
7 votes
Accepted

Archives xkcd comics

First of all, you have multiple PEP8 code style violations, like using camel case styled variable naming instead of a "lower case with underscores"; organizing, grouping imports, comments not ...
alecxe's user avatar
  • 17.3k
6 votes
Accepted

Sending a file over a socket with AES encryption

try-with-resources ...
mdfst13's user avatar
  • 21.6k
6 votes

Auto-upload tool

There's a huge problem with using SendKeys to do anything. The very second the target UI changes at all, your code is broken. As was mentioned in the comments, the right way to do this is by POSTing ...
RubberDuck's user avatar
  • 30.8k
6 votes

Upload an image to a folder through a form

You should invert the order of your PHP processing and your HTML output. When working in PHP, always strive to adhere to this approach, as it will help you as you start working on more complex logic. ...
Mike Brant's user avatar
  • 9,608
5 votes
Accepted

Upload an image to a folder through a form

The first thing I saw when I looked at your code was the obvious disregard to any kind of indentation! It is nearly unreadable! There's no excuse to have a code without any indentation. Throwing the ...
Ismael Miguel's user avatar
5 votes
Accepted

File downloader using Java, multithreading and HTTP Range request

Naming convention, access level and exception handling Java's naming convention do not follow the hungarian notation and thus do not include a leading m for ...
Roman Vottner's user avatar
5 votes
Accepted

Download and write ~100k images

Some minor improvements: I would switch to a NamedTuple instead of a separate class: ...
alecxe's user avatar
  • 17.3k
5 votes

Upload a file asynchronously

Seems a bit needlessly complicated and not exactly async at all. You're just forcing an async call to be synchronous with .Wait(). Proper way is to use async "all ...
Jesse C. Slicer's user avatar
4 votes

A simple PyPI crawler

Here are some comments/notes about the code and potential improvements: use with context manager when opening files parsing HTML with regular expressions has ...
alecxe's user avatar
  • 17.3k
4 votes

User Avatar upload

I honestly don't think there is much to "clean up" here, as this seems pretty straight forward. A few stylistic notes: It is pretty standard in PHP to have variables named with first letter in lower ...
Mike Brant's user avatar
  • 9,608
4 votes
Accepted

Multi-site backup utility with basic sanity checks

Function Level Review `# -*- coding: utf-8 -*-` In Python 3 the default encoding is UTF-8. ...
Peilonrayz's user avatar
  • 43.3k
4 votes
Accepted

Server code to upload and save images to cloud storage

Within resizeImages, the if (req.files.media)... seems to be highly redundant. You seem to be unnecessarily checking for ...
Dave Meehan's user avatar
3 votes

Resumable download with System.net.HTTPClient

Your code looks pretty good to me. Just a few quick notes: There is an Exception.CreateFmt constuctor you can use. For example: ...
Dangph's user avatar
  • 1,683
3 votes

Sending a file over a socket with AES encryption

mdfst13 already gave some useful comments regarding the message digest, so I'd like to add something regarding transferData: When you copy from a file path to a ...
mtj's user avatar
  • 4,812
3 votes

Dynamic software update system using PHP

The biggest problem I see with this code is the extreme level at which you intermingle your browser output with your PHP logic. Developing in this way is going to lead to a codebase that is nearly ...
Mike Brant's user avatar
  • 9,608
3 votes

Uploading photos of various sizes

If Nesting You are nesting if's too much which quickly becomes ugly. I don't know your language but if at all possible negate the the conditions and return the ...
LiefdeWen's user avatar
  • 181
3 votes
Accepted

Uploading photos of various sizes

You can chain those async methods using Promises. So the code will look like this: ...
Yakiv Kovalskyi's user avatar
3 votes
Accepted

Increase speed of Google Drive upload for large files

I ended up diving in boots and all, and figuring it out myself. With the help of google-apis-dotnet-client source, I modified to suit my requirements. I believe this could be implemented in future ...
Brendan Gooden's user avatar
3 votes
Accepted

Laravel: Export customer record as CSV

Try to think about this in a more generic way, you basically have: Select data from DB Put that data in a CSV (will you in the future want to use other formats like XLSX, etc? If so, we should ...
Edson Horacio Junior's user avatar
3 votes
Accepted

Cloud storage using python Socket library

Let's start with the easy stuff. Naming. CloudPy-Client.py is not, by any means, a Pythonic name. cloudpy_client.py is what one ...
miquelvir's user avatar
  • 345
3 votes
Accepted

Image file uploader webpage in HTML5 and PHP

Back end code Add file type checking As this comment on PHP.net mentions: A note of security: Don't ever trust $_FILES["image"]["type"]. It takes whatever is sent from the browser,...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes

PHP readfile() with 304 Not Modified and HTTP 206 Partial Content support: httpreadfile

Looks like a great implementation, even though I am also not an avid specs reader. And yes, I think that error processing could be at least improved. System error handling First of all I would remove ...
Your Common Sense's user avatar
2 votes
Accepted

Profile picture upload method in Laravel 5.2

I think your program is good. I repeat, IMO, it's good. As you said in questions, the answers are Move your image manipulation related methods to a TRAIT. that'll help you while using the same code ...
ssi-anik's user avatar
  • 136
2 votes

Script to download sequentially named files, rename them, and delete smaller files

sh is not bash. This shouldn't be a problem for your script though, because I don't think there are any bashisms in there. Use ...
l0b0's user avatar
  • 8,917
2 votes
Accepted

FTP File Upload Queue

Nested classes Nesting classes is usually a bad idea. I would try to avoid. FTPFileJob You have created this class to group some data about the upload... then you should be consistent are reuse it ...
t3chb0t's user avatar
  • 44.3k
2 votes

Tool to prepare custom screenshots for uploading to Steam Cloud

The entire MainWindow class is too big. It's basically a God class that contains your whole program logic. As you've already tagged the question with ...
D. Jurcau's user avatar
  • 3,010

Only top scored, non community-wiki answers of a minimum length are eligible