All fields

“File Upload Handling” in Information Technology

20 questions across 5 technologies.

Information Technology

20 questions in 5 technologies

#QuestionTechnologyTopicLevel
1How do you move an uploaded file from its temporary location to a permanent storage location using move_uploaded_file? PHP › File Upload HandlingPHPFile Upload HandlingBeginner
2How should you validate an uploaded file's type and size before accepting it, and why is checking only the file extension considered insufficient for security? PHP › File Upload HandlingPHPFile Upload HandlingIntermediate
3How does PHP handle file uploads submitted through an HTML form, and what information does the $_FILES superglobal provide? PHP › File Upload HandlingPHPFile Upload HandlingBeginner
4How do you handle multiple file uploads submitted from a single form field, and what does the resulting $_FILES array structure look like? PHP › File Upload HandlingPHPFile Upload HandlingIntermediate
5How should uploaded file names be sanitized and randomized to avoid security risks and naming conflicts when storing files on the server? PHP › File Upload HandlingPHPFile Upload HandlingIntermediate
6What security risks arise from allowing file uploads into a publicly accessible directory, and how do you prevent uploaded files from being executed as scripts? PHP › File Upload HandlingPHPFile Upload HandlingAdvanced
7How should a large scale application design its file upload architecture to handle high volumes of uploads reliably, including virus scanning and offloading storage to a dedicated service? PHP › File Upload HandlingPHPFile Upload HandlingAdvanced
8What security risks are associated with file handling operations that involve user supplied file paths, and how does path traversal attack prevention work? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsAdvanced
9What HTTP status code and response should be returned when an upload fails validation (wrong type, too large, missing file)? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesBeginner
10How do you validate an uploaded file's actual content type (not just its client-supplied extension or Content-Type header) to prevent malicious file uploads? ASP.NET Core › File Uploads & Streaming Large FilesASP.NET CoreFile Uploads & Streaming Large FilesIntermediate
11How would you implement resumable/chunked file uploads in Node.js to handle very large files over unreliable network connections? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingAdvanced
12How do you check whether a file or directory exists, and how do you retrieve useful metadata like a file's size or last modified time? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsIntermediate
13How would you validate an uploaded image's actual dimensions and reject ones that don't meet minimum or maximum size requirements? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingIntermediate
14How do you work with directories in PHP, including listing their contents, creating new directories, and recursively deleting them? PHP › File Handling & File System FunctionsPHPFile Handling & File System FunctionsIntermediate
15How would you handle file uploads through a form using a server action in Next.js? Next.js › Form Handling & Validation in Next.jsNext.jsForm Handling & Validation in Next.jsAdvanced
16What is the difference between fs.rename() and manually copying then deleting a file, particularly across different filesystems or drives? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleIntermediate
17Why is validating and sanitizing file uploads important, and what specific checks should you perform to prevent an attacker from uploading a malicious file? PHP › SecurityPHPSecurityIntermediate
18How would you use try-with-resources combined with multiple chained I/O wrapper classes (like FileInputStream wrapped in BufferedInputStream wrapped in GZIPInputStream) to correctly read a compressed file while ensuring all layers are properly closed? Java › I/O & NIOJavaI/O & NIOIntermediate
19How do you handle exceptions that occur during response streaming, after the response has already partially started sending to the client? ASP.NET Core › Error HandlingASP.NET CoreError HandlingAdvanced
20How do you send an HTML formatted email with an embedded image or attachment using PHPMailer? PHP › Email Sending in PHP (PHPMailer & SMTP)PHPEmail Sending in PHP (PHPMailer & SMTP)Intermediate