Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 16 for create_files (0.06 seconds)

  1. docs_src/request_forms_and_files/tutorial001_py39.py

    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 317 bytes
    - Click Count (0)
  2. compat/maven-compat/src/test/java/org/apache/maven/artifact/testutils/TestFileManager.java

        protected void finalize() throws Throwable {
            maybeWarnAboutCleanUp();
    
            super.finalize();
        }
    
        public File createFile(String filename, String content, String encoding) throws IOException {
            File dir = createTempDir();
            return createFile(dir, filename, content, encoding);
        }
    Created: Sun Dec 28 03:35:09 GMT 2025
    - Last Modified: Wed Sep 17 10:01:14 GMT 2025
    - 4.8K bytes
    - Click Count (0)
  3. docs_src/request_files/tutorial001_py39.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes = File()):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 282 bytes
    - Click Count (0)
  4. docs_src/request_files/tutorial001_03_py39.py

    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: bytes = File(description="A file read as bytes")):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(
        file: UploadFile = File(description="A file read as UploadFile"),
    ):
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 371 bytes
    - Click Count (0)
  5. docs_src/request_files/tutorial001_02_py39.py

    from typing import Union
    
    from fastapi import FastAPI, File, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Union[bytes, None] = File(default=None)):
        if not file:
            return {"message": "No file sent"}
        else:
            return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: Union[UploadFile, None] = None):
        if not file:
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 508 bytes
    - Click Count (0)
  6. fastapi/datastructures.py

        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import FastAPI, File, UploadFile
    
        app = FastAPI()
    
    
        @app.post("/files/")
        async def create_file(file: Annotated[bytes, File()]):
            return {"file_size": len(file)}
    
    
        @app.post("/uploadfile/")
        async def create_upload_file(file: UploadFile):
            return {"filename": file.filename}
        ```
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 5.1K bytes
    - Click Count (0)
  7. guava-tests/test/com/google/common/reflect/ClassPathTest.java

        //       /[sibling -> left]
        Path root = createTempDirectory("ClassPathTest");
        try {
          Path left = createDirectory(root.resolve("left"));
          createFile(left.resolve("some.txt"));
    
          Path right = createDirectory(root.resolve("right"));
          createFile(right.resolve("another.txt"));
    
          createSymbolicLink(left.resolve("sibling"), right);
          createSymbolicLink(right.resolve("sibling"), left);
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Dec 11 21:00:51 GMT 2025
    - 25.7K bytes
    - Click Count (0)
  8. cmd/erasure-encode_test.go

    	return errFaultyDisk
    }
    
    func (a badDisk) ReadFileStream(ctx context.Context, volume, path string, offset, length int64) (io.ReadCloser, error) {
    	return nil, errFaultyDisk
    }
    
    func (a badDisk) CreateFile(ctx context.Context, origvolume, volume, path string, size int64, reader io.Reader) error {
    	return errFaultyDisk
    }
    
    func (badDisk) Hostname() string {
    	return ""
    }
    
    const oneMiByte = 1 * humanize.MiByte
    
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 11.8K bytes
    - Click Count (0)
  9. internal/lock/lock_windows.go

    	}
    
    	shareflag := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE | syscall.FILE_SHARE_DELETE)
    	accessAttr := uint32(syscall.FILE_ATTRIBUTE_NORMAL | 0x80000000)
    
    	fd, err := syscall.CreateFile(pathp, access, shareflag, nil, createflag, accessAttr, 0)
    	if err != nil {
    		return nil, err
    	}
    
    	return os.NewFile(uintptr(fd), path), nil
    }
    
    func lockFile(fd syscall.Handle, flags uint32) error {
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Sun Sep 28 20:59:21 GMT 2025
    - 7.9K bytes
    - Click Count (0)
  10. src/test/java/org/codelibs/core/io/FileUtilTest.java

            final Path baseDir = tempFolder.getRoot().toPath();
            final Path subDir = Files.createDirectory(baseDir.resolve("subdir"));
            final Path file = Files.createFile(subDir.resolve("test.txt"));
    
            assertTrue("Path inside base should be allowed", FileUtil.isPathSafe(file, baseDir));
        }
    
        /**
         * Test isPathSafe with path outside base directory
         *
    Created: Sat Dec 20 08:55:33 GMT 2025
    - Last Modified: Sat Nov 22 11:21:59 GMT 2025
    - 10.3K bytes
    - Click Count (0)
Back to Top