wavded / ogre

ogr2ogr geojson-focused web client
http://ogre.adc4gis.com
MIT License
266 stars 79 forks source link

"No file provided" when posting .zip of shapefile from C# #72

Closed btcpbordeaux closed 3 years ago

btcpbordeaux commented 6 years ago
public class ConvertShapefileToGeoJson
{
    string URL = "http://ogre.adc4gis.com/convert";

    public async Task<HttpResponseMessage> Convert(string path, string fileName)
    {
        using(var http = new HttpClient())
        {
            byte[] file_bytes = System.IO.File.ReadAllBytes(path);

            MultipartFormDataContent form = new MultipartFormDataContent();

            var content = new ByteArrayContent(file_bytes, 0, file_bytes.Length);
            content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
            {
                Name = "upload",
                FileName = fileName
            };
            content.Headers.ContentType = new MediaTypeHeaderValue("multipart/form-data");
            form.Add(content, "upload", fileName);
            return await http.PostAsync(URL, form);
        }
    }
}

Why is either req.files.upload or req.files.upload.name missing when the node code handles the POST??? This is referencing line 53-57 of ogre/index.js

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.